--TEST-- MongoDB\Driver\BulkWrite cannot be executed multiple times --SKIPIF-- --FILE-- insert(['x' => 1]); $result = $manager->executeBulkWrite(NS, $bulk); printf("Inserted %d document(s)\n", $result->getInsertedCount()); echo throws(function() use ($manager, $bulk) { $result = $manager->executeBulkWrite(NS, $bulk); }, 'MongoDB\Driver\Exception\InvalidArgumentException'), "\n"; ?> ===DONE=== --EXPECTF-- Inserted 1 document(s) OK: Got MongoDB\Driver\Exception\InvalidArgumentException BulkWrite objects may only be executed once and this instance has already been executed ===DONE===