|
8 | 8 | use MongoDB\Driver\BulkWrite as Bulk; |
9 | 9 | use MongoDB\Driver\WriteConcern; |
10 | 10 | use MongoDB\Exception\BadMethodCallException; |
11 | | -use MongoDB\Exception\InvalidArgumentException; |
12 | 11 | use MongoDB\Model\BSONDocument; |
13 | 12 | use MongoDB\Operation\BulkWrite; |
14 | 13 | use MongoDB\Tests\CommandObserver; |
@@ -226,67 +225,6 @@ public function testUnacknowledgedWriteConcernAccessesUpsertedIds(BulkWriteResul |
226 | 225 | $result->getUpsertedIds(); |
227 | 226 | } |
228 | 227 |
|
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 | | - |
290 | 228 | public function testSessionOption() |
291 | 229 | { |
292 | 230 | if (version_compare($this->getServerVersion(), '3.6.0', '<')) { |
|
0 commit comments