public function testCursorConvertsTypes()
{
$this->prepareData();
$collection = $this->getCollection();
$cursor = $collection->find(['foo' => 'bar']);
$this->assertCount(2, $cursor);
$iterated = 0;
foreach ($cursor as $key => $item) {
$this->assertSame($iterated, $cursor->info()['at']);
$this->assertInstanceOf('MongoId', $item['_id']);
$this->assertEquals($key, (string) $item['_id']);
$this->assertSame('bar', $item['foo']);
$iterated++;
}
$this->assertSame(2, $iterated);
}