Doctrine\MongoDB\Tests\Query\QueryTest::testEagerCursorPreparation PHP Method

testEagerCursorPreparation() public method

    public function testEagerCursorPreparation()
    {
        $cursor = $this->getMockCursor();
        $collection = $this->getMockCollection();
        $collection->expects($this->once())->method('find')->with(['foo' => 'bar'])->will($this->returnValue($cursor));
        $queryArray = ['type' => Query::TYPE_FIND, 'query' => ['foo' => 'bar'], 'eagerCursor' => true];
        $query = new Query($collection, $queryArray, []);
        $eagerCursor = $query->execute();
        $this->assertInstanceOf('Doctrine\\MongoDB\\EagerCursor', $eagerCursor);
        $this->assertSame($cursor, $eagerCursor->getCursor());
    }