Skip to content
Browse files

Zend\Db\Sql\Select: simpler test for ZF2-514

  • Loading branch information...
1 parent 294ad43 commit 9c85cc376a0ee1b084849df48d9deae9785e57fa @ralphschindler ralphschindler committed Sep 4, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 tests/ZendTest/Db/Sql/SelectTest.php
View
11 tests/ZendTest/Db/Sql/SelectTest.php
@@ -746,14 +746,15 @@ public function providerData()
'processOrder' => array(array(array('isnull("name") DESC'), array('"name"', Select::ORDER_ASCENDING)))
);
- // join with expression in COLUMNS part (ZF2-514)
+ // join with Expression object in COLUMNS part (ZF2-514)
+ // @co-author Koen Pieters (kpieters)
$select35 = new Select;
- $select35->from('foo')->join('zac', 'm = n', array('bar' => new Expression("IF(foo.id = 1, NULL, foo.bar)")));
+ $select35->from('foo')->columns(array())->join('bar', 'm = n', array('thecount' => new Expression("COUNT(*)")));
$sqlPrep35 = // same
- $sqlStr35 = 'SELECT "foo".*, IF(foo.id = 1, NULL, foo.bar) AS "bar" FROM "foo" INNER JOIN "zac" ON "m" = "n"';
+ $sqlStr35 = 'SELECT COUNT(*) AS "thecount" FROM "foo" INNER JOIN "bar" ON "m" = "n"';
$internalTests35 = array(
- 'processSelect' => array(array(array('"foo".*'), array('IF(foo.id = 1, NULL, foo.bar)', '"bar"')), '"foo"'),
- 'processJoins' => array(array(array('INNER', '"zac"', '"m" = "n"')))
+ 'processSelect' => array(array(array('COUNT(*)', '"thecount"')), '"foo"'),
+ 'processJoins' => array(array(array('INNER', '"bar"', '"m" = "n"')))
);
/**

0 comments on commit 9c85cc3

Please sign in to comment.
Something went wrong with that request. Please try again.