Skip to content

Commit 956f1e1

Browse files
committed
Start iteration with rewind() in more change stream tests
1 parent 40e7065 commit 956f1e1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/Operation/WatchFunctionalTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function testNonEmptyPipeline()
220220

221221
$this->insertDocument(['_id' => 1]);
222222

223-
$changeStream->next();
223+
$changeStream->rewind();
224224
$this->assertTrue($changeStream->valid());
225225

226226
$expectedResult = [
@@ -260,14 +260,17 @@ public function testInitialCursorIsNotClosed()
260260

261261
/**
262262
* @expectedException MongoDB\Exception\ResumeTokenException
263+
* @todo test that rewind() also attempts to extract the resume token once PHPLIB-322 is implemented
263264
*/
264-
public function testFailureAfterResumeTokenRemoved()
265+
public function testNextCannotExtractResumeToken()
265266
{
266267
$pipeline = [['$project' => ['_id' => 0 ]]];
267268

268269
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, ['maxAwaitTimeMS' => 100]);
269270
$changeStream = $operation->execute($this->getPrimaryServer());
270271

272+
$changeStream->rewind();
273+
271274
$this->insertDocument(['x' => 1]);
272275

273276
$changeStream->next();

0 commit comments

Comments
 (0)