Permalink
Browse files

Add more tests for Query\Builder::select()/exclude() (empty array)

  • Loading branch information...
1 parent 412f9e0 commit 0f5014566861349621ece4fec44a574886ecda75 @pierrre pierrre committed Mar 29, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/Doctrine/MongoDB/Tests/Query/BuilderTest.php
View
18 tests/Doctrine/MongoDB/Tests/Query/BuilderTest.php
@@ -538,6 +538,15 @@ public function testSelectWithArray()
$this->assertEquals($expected, $qb->debug('select'));
}
+ public function testSelectWithEmptyArray()
+ {
+ $qb = $this->getTestQueryBuilder()
+ ->select(array());
+
+ $expected = array();
+ $this->assertEquals($expected, $qb->debug('select'));
+ }
+
public function testSelectWithNothing()
{
$qb = $this->getTestQueryBuilder()
@@ -571,6 +580,15 @@ public function testExcludeWithArray()
$this->assertEquals($expected, $qb->debug('select'));
}
+ public function testExcludeWithEmptyArray()
+ {
+ $qb = $this->getTestQueryBuilder()
+ ->exclude(array());
+
+ $expected = array();
+ $this->assertEquals($expected, $qb->debug('select'));
+ }
+
public function testExcludeWithNothing()
{
$qb = $this->getTestQueryBuilder()

0 comments on commit 0f50145

Please sign in to comment.