Commit 956f1e15 authored by Jeremy Mikola's avatar Jeremy Mikola

Start iteration with rewind() in more change stream tests

parent 40e7065e
......@@ -220,7 +220,7 @@ class WatchFunctionalTest extends FunctionalTestCase
$this->insertDocument(['_id' => 1]);
$changeStream->next();
$changeStream->rewind();
$this->assertTrue($changeStream->valid());
$expectedResult = [
......@@ -260,14 +260,17 @@ class WatchFunctionalTest extends FunctionalTestCase
/**
* @expectedException MongoDB\Exception\ResumeTokenException
* @todo test that rewind() also attempts to extract the resume token once PHPLIB-322 is implemented
*/
public function testFailureAfterResumeTokenRemoved()
public function testNextCannotExtractResumeToken()
{
$pipeline = [['$project' => ['_id' => 0 ]]];
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, ['maxAwaitTimeMS' => 100]);
$changeStream = $operation->execute($this->getPrimaryServer());
$changeStream->rewind();
$this->insertDocument(['x' => 1]);
$changeStream->next();
......
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