@@ -954,11 +954,11 @@ public function testChangeStreamExample_1_4()
954
954
955
955
$ changeStream ->next ();
956
956
957
- $ nextChange = $ changeStream ->current ();
957
+ $ secondChange = $ changeStream ->current ();
958
958
// End Changestream Example 2
959
959
960
960
$ this ->assertNull ($ firstChange );
961
- $ this ->assertNull ($ nextChange );
961
+ $ this ->assertNull ($ secondChange );
962
962
963
963
$ insertManyResult = $ db ->inventory ->insertMany ([
964
964
['_id ' => 1 , 'x ' => 'foo ' ],
@@ -984,24 +984,24 @@ public function testChangeStreamExample_1_4()
984
984
$ resumeToken = ($ lastChange !== null ) ? $ lastChange ->_id : null ;
985
985
986
986
if ($ resumeToken === null ) {
987
- throw new \Exception ('resumeToken was not found ' );
987
+ throw new \Exception ('Resume token was not found ' );
988
988
}
989
989
990
990
$ changeStream = $ db ->inventory ->watch ([], ['resumeAfter ' => $ resumeToken ]);
991
991
$ changeStream ->rewind ();
992
992
993
- $ nextChange = $ changeStream ->current ();
993
+ $ firstChange = $ changeStream ->current ();
994
994
// End Changestream Example 3
995
995
996
996
$ expectedChange = [
997
- '_id ' => $ nextChange ->_id ,
997
+ '_id ' => $ firstChange ->_id ,
998
998
'operationType ' => 'insert ' ,
999
999
'fullDocument ' => ['_id ' => 2 , 'x ' => 'bar ' ],
1000
1000
'ns ' => ['db ' => $ this ->getDatabaseName (), 'coll ' => 'inventory ' ],
1001
1001
'documentKey ' => ['_id ' => 2 ],
1002
1002
];
1003
1003
1004
- $ this ->assertMatchesDocument ($ expectedChange , $ nextChange );
1004
+ $ this ->assertMatchesDocument ($ expectedChange , $ firstChange );
1005
1005
1006
1006
// Start Changestream Example 4
1007
1007
$ pipeline = [['$match ' => ['$or ' => [['fullDocument.username ' => 'alice ' ], ['operationType ' => 'delete ' ]]]]];
@@ -1012,11 +1012,11 @@ public function testChangeStreamExample_1_4()
1012
1012
1013
1013
$ changeStream ->next ();
1014
1014
1015
- $ nextChange = $ changeStream ->current ();
1015
+ $ secondChange = $ changeStream ->current ();
1016
1016
// End Changestream Example 4
1017
1017
1018
1018
$ this ->assertNull ($ firstChange );
1019
- $ this ->assertNull ($ nextChange );
1019
+ $ this ->assertNull ($ secondChange );
1020
1020
}
1021
1021
1022
1022
public function testAggregation_example_1 ()
0 commit comments