Permalink
Browse files

Add unit test for Query\Builder::select()

  • Loading branch information...
1 parent ac94f9a commit 20bdf16f68a49eafcee0f4589b7b826c747d2ff3 Pierre Durand committed Mar 29, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/Doctrine/MongoDB/Tests/Query/BuilderTest.php
@@ -514,6 +514,18 @@ public function testWithinPolygonRequiresAtLeastThreePoints()
->field('loc')->withinPolygon(array(0, 0), array(1, 1));
}
+ public function testSelect()
+ {
+ $qb = $this->getTestQueryBuilder()
+ ->select('foo', 'bar');
+
+ $expected = array(
+ 'foo' => 1,
+ 'bar' => 1
+ );
+ $this->assertEquals($expected, $qb->debug('select'));
+ }
+
private function getTestQueryBuilder()
{
return $this->conn->selectCollection('db', 'users')->createQueryBuilder();

0 comments on commit 20bdf16

Please sign in to comment.