--TEST-- MongoDB\Driver\Cursor::toArray() respects type map --SKIPIF-- --FILE-- insert(array('_id' => 1, 'x' => array(1, 2, 3))); $bulk->insert(array('_id' => 2, 'x' => array(4, 5, 6))); $manager->executeBulkWrite(NS, $bulk); $cursor = $manager->executeQuery(NS, new MongoDB\Driver\Query(array('x' => 1))); $cursor->setTypeMap(array("array" => "MyArrayObject")); $documents = $cursor->toArray(); var_dump($documents[0]->x instanceof MyArrayObject); ?> ===DONE=== --EXPECT-- bool(true) ===DONE===