--TEST-- MongoDB\Driver\Server::executeBulkWrite() with legacy write concern (replica set secondary) --SKIPIF-- --FILE-- false]); $server = $manager->selectServer(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_SECONDARY)); $writeConcerns = array(1, 2, MongoDB\Driver\WriteConcern::MAJORITY); foreach ($writeConcerns as $wc) { $bulk = new MongoDB\Driver\BulkWrite(); $bulk->insert(array('wc' => $wc)); echo throws(function() use ($server, $bulk, $wc) { $server->executeBulkWrite(NS, $bulk, new MongoDB\Driver\WriteConcern($wc)); }, "MongoDB\Driver\Exception\RuntimeException"), "\n"; } ?> ===DONE=== --EXPECTF-- OK: Got MongoDB\Driver\Exception\RuntimeException not %r(primary|master)%r OK: Got MongoDB\Driver\Exception\RuntimeException not %r(primary|master)%r OK: Got MongoDB\Driver\Exception\RuntimeException not %r(primary|master)%r ===DONE===