PHPLIB-457: Add prose test numbers in WatchFunctionalTest

parent 7408bf43
...@@ -52,7 +52,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -52,7 +52,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream must continuously track the last seen * Prose test 1: "ChangeStream must continuously track the last seen
* resumeToken" * resumeToken"
*/ */
public function testGetResumeToken() public function testGetResumeToken()
...@@ -87,8 +87,22 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -87,8 +87,22 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream must continuously track the last seen * Prose test 1: "ChangeStream must continuously track the last seen
* resumeToken" * resumeToken"
*
* Prose test 11:
* For a ChangeStream under these conditions:
* - Running against a server >=4.0.7.
* - The batch is empty or has been iterated to the last document.
* Expected result: getResumeToken must return the postBatchResumeToken from
* the current command response.
*
* Prose test 13:
* For a ChangeStream under these conditions:
* - The batch is not empty.
* - The batch has been iterated up to but not including the last element.
* Expected result: getResumeToken must return the _id of the previous
* document returned.
*/ */
public function testGetResumeTokenWithPostBatchResumeToken() public function testGetResumeTokenWithPostBatchResumeToken()
{ {
...@@ -144,7 +158,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -144,7 +158,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will resume after a killCursors command is * Prose test 10: "ChangeStream will resume after a killCursors command is
* issued for its child cursor." * issued for its child cursor."
*/ */
public function testNextResumesAfterCursorNotFound() public function testNextResumesAfterCursorNotFound()
...@@ -301,8 +315,8 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -301,8 +315,8 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "$changeStream stage for ChangeStream against a server >=4.0 * Prose test 9: "$changeStream stage for ChangeStream against a server
* and <4.0.7 that has not received any results yet MUST include a * >=4.0 and <4.0.7 that has not received any results yet MUST include a
* startAtOperationTime option when resuming a changestream." * startAtOperationTime option when resuming a changestream."
*/ */
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime() public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime()
...@@ -691,8 +705,9 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -691,8 +705,9 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "Ensure that a cursor returned from an aggregate command with * Prose test 7: "Ensure that a cursor returned from an aggregate command
* a cursor id and an initial empty batch is not closed on the driver side." * with a cursor id and an initial empty batch is not closed on the driver
* side."
*/ */
public function testInitialCursorIsNotClosed() public function testInitialCursorIsNotClosed()
{ {
...@@ -722,7 +737,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -722,7 +737,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will not attempt to resume after encountering * Prose test 5: "ChangeStream will not attempt to resume after encountering
* error code 11601 (Interrupted), 136 (CappedPositionLost), or 237 * error code 11601 (Interrupted), 136 (CappedPositionLost), or 237
* (CursorKilled) while executing a getMore command." * (CursorKilled) while executing a getMore command."
* *
...@@ -757,9 +772,9 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -757,9 +772,9 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will throw an exception if the server response * Prose test 2: "ChangeStream will throw an exception if the server
* is missing the resume token (if wire version is < 8, this is a driver- * response is missing the resume token (if wire version is < 8, this is a
* side error; for 8+, this is a server-side error)" * driver-side error; for 8+, this is a server-side error)"
*/ */
public function testResumeTokenNotFoundClientSideError() public function testResumeTokenNotFoundClientSideError()
{ {
...@@ -785,9 +800,9 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -785,9 +800,9 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will throw an exception if the server response * Prose test 2: "ChangeStream will throw an exception if the server
* is missing the resume token (if wire version is < 8, this is a driver- * response is missing the resume token (if wire version is < 8, this is a
* side error; for 8+, this is a server-side error)" * driver-side error; for 8+, this is a server-side error)"
*/ */
public function testResumeTokenNotFoundServerSideError() public function testResumeTokenNotFoundServerSideError()
{ {
...@@ -808,9 +823,9 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -808,9 +823,9 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will throw an exception if the server response * Prose test 2: "ChangeStream will throw an exception if the server
* is missing the resume token (if wire version is < 8, this is a driver- * response is missing the resume token (if wire version is < 8, this is a
* side error; for 8+, this is a server-side error)" * driver-side error; for 8+, this is a server-side error)"
*/ */
public function testResumeTokenInvalidTypeClientSideError() public function testResumeTokenInvalidTypeClientSideError()
{ {
...@@ -836,9 +851,9 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -836,9 +851,9 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will throw an exception if the server response * Prose test 2: "ChangeStream will throw an exception if the server
* is missing the resume token (if wire version is < 8, this is a driver- * response is missing the resume token (if wire version is < 8, this is a
* side error; for 8+, this is a server-side error)" * driver-side error; for 8+, this is a server-side error)"
*/ */
public function testResumeTokenInvalidTypeServerSideError() public function testResumeTokenInvalidTypeServerSideError()
{ {
...@@ -1225,7 +1240,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1225,7 +1240,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will automatically resume one time on a * Prose test 3: "ChangeStream will automatically resume one time on a
* resumable error (including not master) with the initial pipeline and * resumable error (including not master) with the initial pipeline and
* options, except for the addition/update of a resumeToken." * options, except for the addition/update of a resumeToken."
*/ */
...@@ -1302,7 +1317,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1302,7 +1317,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will not attempt to resume on any error * Prose test 4: "ChangeStream will not attempt to resume on any error
* encountered while executing an aggregate command." * encountered while executing an aggregate command."
*/ */
public function testErrorDuringAggregateCommandDoesNotCauseResume() public function testErrorDuringAggregateCommandDoesNotCauseResume()
...@@ -1336,8 +1351,8 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1336,8 +1351,8 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "ChangeStream will perform server selection before attempting * Prose test 6: "ChangeStream will perform server selection before
* to resume, using initial readPreference" * attempting to resume, using initial readPreference"
*/ */
public function testOriginalReadPreferenceIsPreservedOnResume() public function testOriginalReadPreferenceIsPreservedOnResume()
{ {
...@@ -1371,7 +1386,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1371,7 +1386,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test * Prose test 12
* For a ChangeStream under these conditions: * For a ChangeStream under these conditions:
* - Running against a server <4.0.7. * - Running against a server <4.0.7.
* - The batch is empty or has been iterated to the last document. * - The batch is empty or has been iterated to the last document.
...@@ -1406,6 +1421,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1406,6 +1421,7 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test 14
* For a ChangeStream under these conditions: * For a ChangeStream under these conditions:
* - The batch is not empty. * - The batch is not empty.
* - The batch hasn’t been iterated at all. * - The batch hasn’t been iterated at all.
...@@ -1467,10 +1483,10 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1467,10 +1483,10 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "$changeStream stage for ChangeStream started with startAfter * Prose test 17: "$changeStream stage for ChangeStream started with
* against a server >=4.1.1 that has not received any results yet MUST * startAfter against a server >=4.1.1 that has not received any results yet
* include a startAfter option and MUST NOT include a resumeAfter option * MUST include a startAfter option and MUST NOT include a resumeAfter
* when resuming a change stream." * option when resuming a change stream."
*/ */
public function testResumingChangeStreamWithoutPreviousResultsIncludesStartAfterOption() public function testResumingChangeStreamWithoutPreviousResultsIncludesStartAfterOption()
{ {
...@@ -1514,10 +1530,10 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -1514,10 +1530,10 @@ class WatchFunctionalTest extends FunctionalTestCase
} }
/** /**
* Prose test: "$changeStream stage for ChangeStream started with startAfter * Prose test 18: "$changeStream stage for ChangeStream started with
* against a server >=4.1.1 that has received at least one result MUST * startAfter against a server >=4.1.1 that has received at least one result
* include a resumeAfter option and MUST NOT include a startAfter option * MUST include a resumeAfter option and MUST NOT include a startAfter
* when resuming a change stream." * option when resuming a change stream."
*/ */
public function testResumingChangeStreamWithPreviousResultsIncludesResumeAfterOption() public function testResumingChangeStreamWithPreviousResultsIncludesResumeAfterOption()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment