- 05 Feb, 2018 16 commits
-
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
The resume callable does not change, so we can create it once from the Manager provided to Watch's constructor.
-
Jeremy Mikola authored
-
Jeremy Mikola authored
UnexpectedValueException is only relevant for non-cursor aggregations, and UnsupportedException due to a write concern is not relevant for change streams.
-
Jeremy Mikola authored
Previously, Watch did not validate the "fullDocument" option and neglected to pass "readConcern" and "readPreference" to Aggregate. This refactors the class so that Watch only processes its own options. Additionally, Aggregate is now first created from Watch::__construct() instead of Watch::execute(), which allows its options to be validated earlier (akin to FindOne creating Find in its constructor). Aggregate is only recreated if a new resume token is provided during a resume.
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Katherine Walker authored
-
Katherine Walker authored
-
Katherine Walker authored
-
Katherine Walker authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
Read concern is supported by all server versions that support change streams, so we need not discuss its requirement.
-
Jeremy Mikola authored
-
- 02 Feb, 2018 24 commits
-
-
Jeremy Mikola authored
-
Jeremy Mikola authored
The spec requests that we check that the initial change stream cursor is alive. This can be done by both asserting its cursor ID is non-zero and also calling MongoDB\Driver\Cursor::isDead().
-
Jeremy Mikola authored
Previously, iteration started with next(), so the first element's key was 1. Iteration should being with rewind() and the initial key should be zero. With this change, we're still testing that the key is only incremented when next() successfully increments.
-
Jeremy Mikola authored
Resume tests for rewind() will be reimplemented in PHPLIB-322
-
Jeremy Mikola authored
This also adds more assertions between the doc examples.
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
This also removes the hard-coded database and collection names, which are subject to change based on the test suite configuration and getCollectionName() implementation.
-
Jeremy Mikola authored
The original intention of this test was to verify resumability in the event of a dropped connection; however, since socketTimeoutMS and maxAwaitTimeMS are fixed values, we cannot test a dropped connection followed by a successful resume. Instead, we will test that the driver attempts to resume once and only once before we expect a socket timeout after the second attempt. Note: ChangeStream::rewind() does not currently resume (see: PHPLIB-322)
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
Change streams require a replica set.
-
Jeremy Mikola authored
Refactoring the change stream tests to execute Watch directly highlighted a bug where no read preference was available during the resume process. This ensures that a read preference is always set, and also specifies a "fullDocument" default (consistent with other drivers).
-
Jeremy Mikola authored
For consistency with other operation functional tests, this now constructs and executes operation classes directly.
-
Jeremy Mikola authored
The batchSize option for change streams is not identical to the aggregate option, so they should not share the same text. That said, the batchSize option likely has no effect on the resulting change stream (see: PHPLIB-321).
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
-
Jeremy Mikola authored
This makes the constructor consistent with other classes (e.g. Client, GridFS\Bucket) and also ensures that we don't have required parameters trailing optional arguments (i.e. options array).
-
Jeremy Mikola authored
-
Jeremy Mikola authored
This makes the operation consistent with the Collection method name and avoids the naming conflict with the ChangeStream iterator class.
-
Katherine Walker authored
-