Alcaeus\MongoDbAdapter\Tests\Mongo\MongoCursorTest::testCursorInfo PHP Метод

testCursorInfo() публичный Метод

public testCursorInfo ( )
    public function testCursorInfo()
    {
        $this->prepareData();
        $collection = $this->getCollection();
        $cursor = $collection->find(['foo' => 'bar'], ['_id' => false])->skip(1)->limit(3);
        $expected = ['ns' => 'mongo-php-adapter.test', 'limit' => 3, 'batchSize' => 0, 'skip' => 1, 'flags' => 0, 'query' => ['foo' => 'bar'], 'fields' => ['_id' => false], 'started_iterating' => false];
        $this->assertEquals($expected, $cursor->info());
        // Ensure cursor started iterating
        iterator_to_array($cursor);
        $expected['started_iterating'] = true;
        $expected += ['id' => 0, 'at' => 1, 'numReturned' => 1, 'server' => 'localhost:27017;-;.;' . getmypid(), 'host' => 'localhost', 'port' => 27017, 'connection_type_desc' => 'STANDALONE'];
        $this->assertEquals($expected, $cursor->info());
    }