Skip to content

Commit a1d9c7b

Browse files
committed
Rename and fix Bulk::update() arrayFilters test
Query should not be passed as the first argument to Bulk::update(). As-is, the Query object was encoded as an empty BSON document and caused the update operation to match three documents instead of two. This happened to have no effect on the test result because arrayFilters ensured that only grades >= 100 were matched.
1 parent 6db4790 commit a1d9c7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/bulk/bulkwrite-update-arrayFilters-001.phpt renamed to tests/bulk/bulkwrite-update-002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
MongoDB\Driver\BulkWrite::update with arrayFilters
2+
MongoDB\Driver\BulkWrite::update() with arrayFilters option
33
--SKIPIF--
44
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
55
<?php skip_if_not_live(); ?>
@@ -21,7 +21,7 @@ $manager->executeBulkWrite(DATABASE_NAME . '.' . COLLECTION_NAME, $bulk);
2121

2222
$updateBulk = new MongoDB\Driver\BulkWrite();
2323

24-
$query = new MongoDB\Driver\Query(['grades' => ['$gte' => 100]]);
24+
$query = ['grades' => ['$gte' => 100]];
2525
$update = [ '$set' => [ 'grades.$[element]' => 100 ] ];
2626
$options = [
2727
'arrayFilters' => [ [ 'element' => [ '$gte' => 100 ] ] ],

0 commit comments

Comments
 (0)