ExamplesTest makes assertion on var_dump output, but xdebug modifies this output.
Solution : use an other dumping function, like var_export.
--- Expected +++ Actual @@ @@ -object(MongoDB\Examples\TypeMapEntry)#%d (%d) { - ["id":"MongoDB\Examples\TypeMapEntry":private]=> - object(MongoDB\BSON\ObjectId)#%d (%d) { - ["oid"]=> - string(24) "%s" +/Users/jerome/Develop/mongo-php-library/examples/typemap.php:120: +class MongoDB\Examples\TypeMapEntry#7 (3) { + private $id => + class MongoDB\BSON\ObjectId#43 (1) { + public $oid => + string(24) "6464a1913a4af41b2f0a7614" } - ["name":"MongoDB\Examples\TypeMapEntry":private]=> + private $name => string(7) "alcaeus" - ["emails":"MongoDB\Examples\TypeMapEntry":private]=> + private $emails => array(2) { - [0]=> - object(MongoDB\Examples\TypeMapEmail)#%d (%d) { - ["type":"MongoDB\Examples\TypeMapEmail":private]=> + [0] => + class MongoDB\Examples\TypeMapEmail#46 (2) { + private $type => string(4) "work" - ["address":"MongoDB\Examples\TypeMapEmail":private]=> + private $address => string(19) "alcaeus@example.com" } - [1]=> - object(MongoDB\Examples\TypeMapEmail)#%d (%d) { - ["type":"MongoDB\Examples\TypeMapEmail":private]=> + [1] => + class MongoDB\Examples\TypeMapEmail#53 (2) { + private $type => string(7) "private" - ["address":"MongoDB\Examples\TypeMapEmail":private]=> + private $address => string(18) "secret@example.com" } } -} +}