Skip to content

Commit 738022d

Browse files
committed
PHPLIB-481: Remove duplicated bulk write tests
1 parent d4b5e8d commit 738022d

File tree

1 file changed

+0
-62
lines changed

1 file changed

+0
-62
lines changed

tests/Operation/BulkWriteFunctionalTest.php

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use MongoDB\Driver\BulkWrite as Bulk;
99
use MongoDB\Driver\WriteConcern;
1010
use MongoDB\Exception\BadMethodCallException;
11-
use MongoDB\Exception\InvalidArgumentException;
1211
use MongoDB\Model\BSONDocument;
1312
use MongoDB\Operation\BulkWrite;
1413
use MongoDB\Tests\CommandObserver;
@@ -226,67 +225,6 @@ public function testUnacknowledgedWriteConcernAccessesUpsertedIds(BulkWriteResul
226225
$result->getUpsertedIds();
227226
}
228227

229-
public function testUnknownOperation()
230-
{
231-
$this->expectException(InvalidArgumentException::class);
232-
$this->expectExceptionMessage('Unknown operation type "foo" in $operations[0]');
233-
new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [
234-
['foo' => [['_id' => 1]]],
235-
]);
236-
}
237-
238-
/**
239-
* @dataProvider provideOpsWithMissingArguments
240-
*/
241-
public function testMissingArguments(array $ops)
242-
{
243-
$this->expectException(InvalidArgumentException::class);
244-
$this->expectExceptionMessageRegExp('/Missing (first|second) argument for \$operations\[\d+\]\["\w+\"]/');
245-
new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), $ops);
246-
}
247-
248-
public function provideOpsWithMissingArguments()
249-
{
250-
return [
251-
[[['insertOne' => []]]],
252-
[[['updateOne' => []]]],
253-
[[['updateOne' => [['_id' => 1]]]]],
254-
[[['updateMany' => []]]],
255-
[[['updateMany' => [['_id' => 1]]]]],
256-
[[['replaceOne' => []]]],
257-
[[['replaceOne' => [['_id' => 1]]]]],
258-
[[['deleteOne' => []]]],
259-
[[['deleteMany' => []]]],
260-
];
261-
}
262-
263-
public function testUpdateOneRequiresUpdateOperators()
264-
{
265-
$this->expectException(InvalidArgumentException::class);
266-
$this->expectExceptionMessage('First key in $operations[0]["updateOne"][1] is neither an update operator nor a pipeline');
267-
new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [
268-
['updateOne' => [['_id' => 1], ['x' => 1]]],
269-
]);
270-
}
271-
272-
public function testUpdateManyRequiresUpdateOperators()
273-
{
274-
$this->expectException(InvalidArgumentException::class);
275-
$this->expectExceptionMessage('First key in $operations[0]["updateMany"][1] is neither an update operator nor a pipeline');
276-
new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [
277-
['updateMany' => [['_id' => ['$gt' => 1]], ['x' => 1]]],
278-
]);
279-
}
280-
281-
public function testReplaceOneRequiresReplacementDocument()
282-
{
283-
$this->expectException(InvalidArgumentException::class);
284-
$this->expectExceptionMessage('First key in $operations[0]["replaceOne"][1] is an update operator');
285-
new BulkWrite($this->getDatabaseName(), $this->getCollectionName(), [
286-
['replaceOne' => [['_id' => 1], ['$inc' => ['x' => 1]]]],
287-
]);
288-
}
289-
290228
public function testSessionOption()
291229
{
292230
if (version_compare($this->getServerVersion(), '3.6.0', '<')) {

0 commit comments

Comments
 (0)