-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--TEST-- | ||
MongoDB\Driver\BulkWrite cannot be executed multiple times | ||
--SKIPIF-- | ||
<?php require __DIR__ . "/../utils/basic-skipif.inc"; CLEANUP(STANDALONE); ?> | ||
--FILE-- | ||
<?php | ||
require_once __DIR__ . "/../utils/basic.inc"; | ||
|
||
$manager = new MongoDB\Driver\Manager(STANDALONE); | ||
|
||
$bulk = new MongoDB\Driver\BulkWrite; | ||
$bulk->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\BulkWriteException'), "\n"; | ||
|
||
?> | ||
===DONE=== | ||
<?php exit(0); ?> | ||
--EXPECTF-- | ||
Inserted 1 document(s) | ||
OK: Got MongoDB\Driver\Exception\BulkWriteException | ||
BulkWrite objects may only be executed once and this instance has already been executed | ||
===DONE=== |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters