--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" : { "$numberInt" : "-1" } } { "w" : { "$numberInt" : "0" } } { "w" : { "$numberInt" : "1" } } { "w" : "majority" } { "w" : "tag" } { "w" : { "$numberInt" : "1" } } { "w" : { "$numberInt" : "1" }, "j" : false } { "w" : { "$numberInt" : "1" }, "wtimeout" : { "$numberInt" : "1000" } } { "w" : { "$numberInt" : "1" }, "j" : true, "wtimeout" : { "$numberInt" : "1000" } } { "j" : true } { "wtimeout" : { "$numberInt" : "1000" } } ===DONE===