--TEST-- MongoDB\Driver\WriteConcern::bsonSerialize() returns an object --FILE-- 1 new MongoDB\Driver\WriteConcern(-2, 1000), ]; foreach ($tests as $test) { var_dump($test->bsonSerialize()); } ?> ===DONE=== --EXPECTF-- object(stdClass)#%d (%d) { ["w"]=> string(8) "majority" } object(stdClass)#%d (%d) { } object(stdClass)#%d (%d) { ["w"]=> int(-1) } object(stdClass)#%d (%d) { ["w"]=> int(0) } object(stdClass)#%d (%d) { ["w"]=> int(1) } object(stdClass)#%d (%d) { ["w"]=> string(8) "majority" } object(stdClass)#%d (%d) { ["w"]=> string(3) "tag" } object(stdClass)#%d (%d) { ["w"]=> int(1) } object(stdClass)#%d (%d) { ["w"]=> int(1) ["j"]=> bool(false) } object(stdClass)#%d (%d) { ["w"]=> int(1) ["wtimeout"]=> int(1000) } object(stdClass)#%d (%d) { ["w"]=> int(1) ["j"]=> bool(true) ["wtimeout"]=> int(1000) } object(stdClass)#%d (%d) { ["j"]=> bool(true) } object(stdClass)#%d (%d) { ["wtimeout"]=> int(1000) } ===DONE===