--TEST-- MongoDB\Driver\Manager::executeWriteCommand() throws CommandException for invalid writeConcern --SKIPIF-- --FILE-- COLLECTION_NAME, 'query' => ['_id' => 'foo'], 'update' => ['foo' => ['bar']], 'upsert' => true, 'new' => true, ]); try { $manager->executeWriteCommand(DATABASE_NAME, $command, ['writeConcern' => new MongoDB\Driver\WriteConcern("undefined")]); } catch (MongoDB\Driver\Exception\CommandException $e) { printf("%s(%d): %s\n", get_class($e), $e->getCode(), $e->getMessage()); } ?> ===DONE=== --EXPECT-- MongoDB\Driver\Exception\CommandException(79): Write Concern error: No write concern mode named 'undefined' found in replica set configuration ===DONE===