--TEST-- MongoDB\Driver\WriteConcern::bsonSerialize() --FILE-- 1 new MongoDB\Driver\WriteConcern(-2, 1000), ]; foreach ($tests as $test) { echo toJSON(fromPHP($test)), "\n"; } ?> ===DONE=== --EXPECT-- { "w" : "majority" } { } { "w" : -1 } { "w" : 0 } { "w" : 1 } { "w" : "majority" } { "w" : "tag" } { "w" : 1 } { "w" : 1, "j" : false } { "w" : 1, "wtimeout" : 1000 } { "w" : 1, "j" : true, "wtimeout" : 1000 } { "j" : true } { "wtimeout" : 1000 } ===DONE===