public function testFind() { for ($i = 0; $i < 50; $i++) { $this->object->insert((object) array('x' => $i)); } $c = $this->object->find(); $this->assertEquals(iterator_count($c), 50); $c = $this->object->find(array()); $this->assertEquals(iterator_count($c), 50); $this->object->insert((object) array("foo" => "bar", "a" => "b", "b" => "c")); $c = $this->object->find((object) array('foo' => 'bar'), (object) array('a' => 1, 'b' => 1)); $this->assertTrue($c instanceof MongoCursor); $obj = $c->getNext(); $this->assertEquals('b', $obj['a']); $this->assertEquals('c', $obj['b']); $this->assertEquals(false, array_key_exists('foo', $obj)); }