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

Commit

Permalink
Zend\Db\Sql
Browse files Browse the repository at this point in the history
* Added unit test for Zend\Db\Sql\Predicate\Between for ctor boundary checking
  • Loading branch information
Ralph Schindler committed Nov 20, 2012
1 parent 060b9c1 commit a326c5c
Showing 1 changed file with 13 additions and 2 deletions.
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 a326c5c

Please sign in to comment.