Commit 42bf8258 authored by Katherine Walker's avatar Katherine Walker

Rename test cases

parent af3ec661
...@@ -128,7 +128,7 @@ class ChangeStream implements Iterator ...@@ -128,7 +128,7 @@ class ChangeStream implements Iterator
$resumable = true; $resumable = true;
} }
if ($e->getCode() === self::CURSOR_NOT_FOUND) { if ($e->getCode() === self::CURSOR_NOT_FOUND) {
$resumable = true; $resumable = true;
} }
if ($e instanceof ConnectionTimeoutException) { if ($e instanceof ConnectionTimeoutException) {
$resumable = true; $resumable = true;
......
...@@ -315,6 +315,8 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -315,6 +315,8 @@ class WatchFunctionalTest extends FunctionalTestCase
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, ['maxAwaitTimeMS' => 100]); $operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, ['maxAwaitTimeMS' => 100]);
$changeStream = $operation->execute($this->getPrimaryServer()); $changeStream = $operation->execute($this->getPrimaryServer());
/* Note: we intentionally do not start iteration with rewind() to ensure
* that we test extraction functionality within next(). */
$this->insertDocument(['x' => 1]); $this->insertDocument(['x' => 1]);
$changeStream->next(); $changeStream->next();
...@@ -379,13 +381,11 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -379,13 +381,11 @@ class WatchFunctionalTest extends FunctionalTestCase
$this->assertTrue($changeStream->valid()); $this->assertTrue($changeStream->valid());
} }
public function testResumeAfterKillThenNoOperations() public function testRewindResumesAfterCursorNotFound()
{ {
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], ['maxAwaitTimeMS' => 100]); $operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], ['maxAwaitTimeMS' => 100]);
$changeStream = $operation->execute($this->getPrimaryServer()); $changeStream = $operation->execute($this->getPrimaryServer());
$this->insertDocument(['_id' => 1, 'x' => 'foo']);
$this->killChangeStreamCursor($changeStream); $this->killChangeStreamCursor($changeStream);
$changeStream->rewind(); $changeStream->rewind();
...@@ -393,7 +393,7 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -393,7 +393,7 @@ class WatchFunctionalTest extends FunctionalTestCase
$this->assertNull($changeStream->current()); $this->assertNull($changeStream->current());
} }
public function testResumeAfterKillThenOperation() public function testRewindExtractsResumeTokenAndNextResumes()
{ {
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], ['maxAwaitTimeMS' => 100]); $operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], ['maxAwaitTimeMS' => 100]);
$changeStream = $operation->execute($this->getPrimaryServer()); $changeStream = $operation->execute($this->getPrimaryServer());
......
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