--TEST-- MongoDB\Driver\Manager::executeWriteCommand() write concern inheritance --SKIPIF-- --FILE-- 2, 'wtimeoutms' => 1000]); $command = new MongoDB\Driver\Command([ 'findAndModify' => COLLECTION_NAME, 'query' => ['x' => 1], 'upsert' => true, 'new' => true, 'update' => ['$inc' => ['x' => 1]], ]); (new CommandObserver)->observe( function() use ($manager, $command) { $manager->executeWriteCommand(DATABASE_NAME, $command); $manager->executeWriteCommand(DATABASE_NAME, $command, ['writeConcern' => new MongoDB\Driver\WriteConcern(1)]); }, function(stdClass $command) { echo json_encode($command->writeConcern), "\n"; } ); ?> ===DONE=== --EXPECT-- {"w":2,"wtimeout":1000} {"w":1} ===DONE===