Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'stormwild-hotfix/3001' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Schindler committed Nov 20, 2012
2 parents 27ad660 + 54ca083 commit e949371
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Db/Sql/Predicate/Between.php
Expand Up @@ -34,10 +34,10 @@ public function __construct($identifier = null, $minValue = null, $maxValue = nu
if ($identifier) {
$this->setIdentifier($identifier);
}
if ($minValue) {
if (!is_null($minValue)) {
$this->setMinValue($minValue);
}
if ($maxValue) {
if (!is_null($maxValue)) {
$this->setMaxValue($maxValue);
}
}
Expand Down
15 changes: 13 additions & 2 deletions tests/ZendTest/Db/Sql/Predicate/BetweenTest.php
Expand Up @@ -48,8 +48,18 @@ public function testConstructorCanPassIdentifierMinimumAndMaximumValues()
{
$between = new Between('foo.bar', 1, 300);
$this->assertEquals('foo.bar', $between->getIdentifier());
$this->assertEquals(1, $between->getMinValue());
$this->assertEquals(300, $between->getMaxValue());
$this->assertSame(1, $between->getMinValue());
$this->assertSame(300, $between->getMaxValue());

$between = new Between('foo.bar', 0, 1);
$this->assertEquals('foo.bar', $between->getIdentifier());
$this->assertSame(0, $between->getMinValue());
$this->assertSame(1, $between->getMaxValue());

$between = new Between('foo.bar', -1, 0);
$this->assertEquals('foo.bar', $between->getIdentifier());
$this->assertSame(-1, $between->getMinValue());
$this->assertSame(0, $between->getMaxValue());
}

/**
Expand Down Expand Up @@ -117,4 +127,5 @@ public function testRetrievingWherePartsReturnsSpecificationArrayOfIdentifierAnd
));
$this->assertEquals($expected, $this->between->getExpressionData());
}

}

0 comments on commit e949371

Please sign in to comment.