@@ -52,7 +52,7 @@ private function doSetUp()
52
52
}
53
53
54
54
/**
55
- * Prose test: "ChangeStream must continuously track the last seen
55
+ * Prose test 1 : "ChangeStream must continuously track the last seen
56
56
* resumeToken"
57
57
*/
58
58
public function testGetResumeToken ()
@@ -87,8 +87,22 @@ public function testGetResumeToken()
87
87
}
88
88
89
89
/**
90
- * Prose test: "ChangeStream must continuously track the last seen
90
+ * Prose test 1 : "ChangeStream must continuously track the last seen
91
91
* resumeToken"
92
+ *
93
+ * Prose test 11:
94
+ * For a ChangeStream under these conditions:
95
+ * - Running against a server >=4.0.7.
96
+ * - The batch is empty or has been iterated to the last document.
97
+ * Expected result: getResumeToken must return the postBatchResumeToken from
98
+ * the current command response.
99
+ *
100
+ * Prose test 13:
101
+ * For a ChangeStream under these conditions:
102
+ * - The batch is not empty.
103
+ * - The batch has been iterated up to but not including the last element.
104
+ * Expected result: getResumeToken must return the _id of the previous
105
+ * document returned.
92
106
*/
93
107
public function testGetResumeTokenWithPostBatchResumeToken ()
94
108
{
@@ -144,7 +158,7 @@ function (array $event) use (&$events) {
144
158
}
145
159
146
160
/**
147
- * Prose test: "ChangeStream will resume after a killCursors command is
161
+ * Prose test 10 : "ChangeStream will resume after a killCursors command is
148
162
* issued for its child cursor."
149
163
*/
150
164
public function testNextResumesAfterCursorNotFound ()
@@ -301,8 +315,8 @@ private function assertResumeAfter($expectedResumeToken, stdClass $command)
301
315
}
302
316
303
317
/**
304
- * Prose test: "$changeStream stage for ChangeStream against a server >=4.0
305
- * and <4.0.7 that has not received any results yet MUST include a
318
+ * Prose test 9 : "$changeStream stage for ChangeStream against a server
319
+ * >=4.0 and <4.0.7 that has not received any results yet MUST include a
306
320
* startAtOperationTime option when resuming a changestream."
307
321
*/
308
322
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime ()
@@ -691,8 +705,9 @@ public function testNonEmptyPipeline()
691
705
}
692
706
693
707
/**
694
- * Prose test: "Ensure that a cursor returned from an aggregate command with
695
- * a cursor id and an initial empty batch is not closed on the driver side."
708
+ * Prose test 7: "Ensure that a cursor returned from an aggregate command
709
+ * with a cursor id and an initial empty batch is not closed on the driver
710
+ * side."
696
711
*/
697
712
public function testInitialCursorIsNotClosed ()
698
713
{
@@ -722,7 +737,7 @@ public function testInitialCursorIsNotClosed()
722
737
}
723
738
724
739
/**
725
- * Prose test: "ChangeStream will not attempt to resume after encountering
740
+ * Prose test 5 : "ChangeStream will not attempt to resume after encountering
726
741
* error code 11601 (Interrupted), 136 (CappedPositionLost), or 237
727
742
* (CursorKilled) while executing a getMore command."
728
743
*
@@ -757,9 +772,9 @@ public function provideNonResumableErrorCodes()
757
772
}
758
773
759
774
/**
760
- * Prose test: "ChangeStream will throw an exception if the server response
761
- * is missing the resume token (if wire version is < 8, this is a driver-
762
- * side error; for 8+, this is a server-side error)"
775
+ * Prose test 2 : "ChangeStream will throw an exception if the server
776
+ * response is missing the resume token (if wire version is < 8, this is a
777
+ * driver- side error; for 8+, this is a server-side error)"
763
778
*/
764
779
public function testResumeTokenNotFoundClientSideError ()
765
780
{
@@ -785,9 +800,9 @@ public function testResumeTokenNotFoundClientSideError()
785
800
}
786
801
787
802
/**
788
- * Prose test: "ChangeStream will throw an exception if the server response
789
- * is missing the resume token (if wire version is < 8, this is a driver-
790
- * side error; for 8+, this is a server-side error)"
803
+ * Prose test 2 : "ChangeStream will throw an exception if the server
804
+ * response is missing the resume token (if wire version is < 8, this is a
805
+ * driver- side error; for 8+, this is a server-side error)"
791
806
*/
792
807
public function testResumeTokenNotFoundServerSideError ()
793
808
{
@@ -808,9 +823,9 @@ public function testResumeTokenNotFoundServerSideError()
808
823
}
809
824
810
825
/**
811
- * Prose test: "ChangeStream will throw an exception if the server response
812
- * is missing the resume token (if wire version is < 8, this is a driver-
813
- * side error; for 8+, this is a server-side error)"
826
+ * Prose test 2 : "ChangeStream will throw an exception if the server
827
+ * response is missing the resume token (if wire version is < 8, this is a
828
+ * driver- side error; for 8+, this is a server-side error)"
814
829
*/
815
830
public function testResumeTokenInvalidTypeClientSideError ()
816
831
{
@@ -836,9 +851,9 @@ public function testResumeTokenInvalidTypeClientSideError()
836
851
}
837
852
838
853
/**
839
- * Prose test: "ChangeStream will throw an exception if the server response
840
- * is missing the resume token (if wire version is < 8, this is a driver-
841
- * side error; for 8+, this is a server-side error)"
854
+ * Prose test 2 : "ChangeStream will throw an exception if the server
855
+ * response is missing the resume token (if wire version is < 8, this is a
856
+ * driver- side error; for 8+, this is a server-side error)"
842
857
*/
843
858
public function testResumeTokenInvalidTypeServerSideError ()
844
859
{
@@ -1225,7 +1240,7 @@ public function testSessionFreed()
1225
1240
}
1226
1241
1227
1242
/**
1228
- * Prose test: "ChangeStream will automatically resume one time on a
1243
+ * Prose test 3 : "ChangeStream will automatically resume one time on a
1229
1244
* resumable error (including not master) with the initial pipeline and
1230
1245
* options, except for the addition/update of a resumeToken."
1231
1246
*/
@@ -1302,7 +1317,7 @@ function (array $aggregateCommand) {
1302
1317
}
1303
1318
1304
1319
/**
1305
- * Prose test: "ChangeStream will not attempt to resume on any error
1320
+ * Prose test 4 : "ChangeStream will not attempt to resume on any error
1306
1321
* encountered while executing an aggregate command."
1307
1322
*/
1308
1323
public function testErrorDuringAggregateCommandDoesNotCauseResume ()
@@ -1336,8 +1351,8 @@ function (array $event) use (&$commandCount) {
1336
1351
}
1337
1352
1338
1353
/**
1339
- * Prose test: "ChangeStream will perform server selection before attempting
1340
- * to resume, using initial readPreference"
1354
+ * Prose test 6 : "ChangeStream will perform server selection before
1355
+ * attempting to resume, using initial readPreference"
1341
1356
*/
1342
1357
public function testOriginalReadPreferenceIsPreservedOnResume ()
1343
1358
{
@@ -1371,7 +1386,7 @@ function () {
1371
1386
}
1372
1387
1373
1388
/**
1374
- * Prose test
1389
+ * Prose test 12
1375
1390
* For a ChangeStream under these conditions:
1376
1391
* - Running against a server <4.0.7.
1377
1392
* - The batch is empty or has been iterated to the last document.
@@ -1406,6 +1421,7 @@ public function testGetResumeTokenReturnsOriginalResumeTokenOnEmptyBatch()
1406
1421
}
1407
1422
1408
1423
/**
1424
+ * Prose test 14
1409
1425
* For a ChangeStream under these conditions:
1410
1426
* - The batch is not empty.
1411
1427
* - The batch hasn’t been iterated at all.
@@ -1467,10 +1483,10 @@ public function testResumeTokenBehaviour()
1467
1483
}
1468
1484
1469
1485
/**
1470
- * Prose test: "$changeStream stage for ChangeStream started with startAfter
1471
- * against a server >=4.1.1 that has not received any results yet MUST
1472
- * include a startAfter option and MUST NOT include a resumeAfter option
1473
- * when resuming a change stream."
1486
+ * Prose test 17 : "$changeStream stage for ChangeStream started with
1487
+ * startAfter against a server >=4.1.1 that has not received any results yet
1488
+ * MUST include a startAfter option and MUST NOT include a resumeAfter
1489
+ * option when resuming a change stream."
1474
1490
*/
1475
1491
public function testResumingChangeStreamWithoutPreviousResultsIncludesStartAfterOption ()
1476
1492
{
@@ -1514,10 +1530,10 @@ function (array $event) use (&$aggregateCommand) {
1514
1530
}
1515
1531
1516
1532
/**
1517
- * Prose test: "$changeStream stage for ChangeStream started with startAfter
1518
- * against a server >=4.1.1 that has received at least one result MUST
1519
- * include a resumeAfter option and MUST NOT include a startAfter option
1520
- * when resuming a change stream."
1533
+ * Prose test 18 : "$changeStream stage for ChangeStream started with
1534
+ * startAfter against a server >=4.1.1 that has received at least one result
1535
+ * MUST include a resumeAfter option and MUST NOT include a startAfter
1536
+ * option when resuming a change stream."
1521
1537
*/
1522
1538
public function testResumingChangeStreamWithPreviousResultsIncludesResumeAfterOption ()
1523
1539
{
0 commit comments