--TEST-- MongoDB\Driver\WriteResult::getWriteConcernError() --SKIPIF-- --FILE-- insert(['x' => 1]); try { /* We assume that the replica set does not have 12 nodes */ $result = $manager->executeBulkWrite(NS, $bulk, ['writeConcern' => new MongoDB\Driver\WriteConcern(12)]); } catch (MongoDB\Driver\Exception\BulkWriteException $e) { var_dump($e->getWriteResult()->getWriteConcernError()); var_dump($e->getWriteResult()->writeConcernError); } ?> ===DONE=== --EXPECTF-- object(MongoDB\Driver\WriteConcernError)#%d (%d) { ["message"]=> string(29) "Not enough data-bearing nodes" ["code"]=> int(100) ["info"]=> %a } object(MongoDB\Driver\WriteConcernError)#%d (%d) { ["message"]=> string(29) "Not enough data-bearing nodes" ["code"]=> int(100) ["info"]=> %a } ===DONE===