Created
February 20, 2012 17:54
-
-
Save havvg/1870305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CriteriaTest extends BookstoreTestBase | |
{ | |
public function testMultipleHaving() | |
{ | |
$c = new Criteria(); | |
$c->addSelectColumn(BookPeer::TITLE); | |
$c->addAsColumn('isb_n', BookPeer::ISBN); | |
$crit = $c->getNewCriterion('isb_n', '1234567890123'); | |
$crit->addAnd($c->getNewCriterion(BookPeer::TITLE, 'Foobar')); | |
$c->addHaving($crit); | |
$expected = 'SELECT book.TITLE, book.ISBN AS isb_n FROM book HAVING (isb_n=:p1 AND book.TITLE=:p2)'; | |
$params = array(); | |
$result = BasePeer::createSelectSql($c, $params); | |
$this->assertEquals($expected, $result); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment