Skip to content

Commit 42bf825

Browse files
committed
Rename test cases
1 parent af3ec66 commit 42bf825

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ChangeStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function rewind()
128128
$resumable = true;
129129
}
130130
if ($e->getCode() === self::CURSOR_NOT_FOUND) {
131-
$resumable = true;
131+
$resumable = true;
132132
}
133133
if ($e instanceof ConnectionTimeoutException) {
134134
$resumable = true;

tests/Operation/WatchFunctionalTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ public function testNextCannotExtractResumeToken()
315315
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, ['maxAwaitTimeMS' => 100]);
316316
$changeStream = $operation->execute($this->getPrimaryServer());
317317

318+
/* Note: we intentionally do not start iteration with rewind() to ensure
319+
* that we test extraction functionality within next(). */
318320
$this->insertDocument(['x' => 1]);
319321

320322
$changeStream->next();
@@ -379,21 +381,19 @@ public function testMaxAwaitTimeMS()
379381
$this->assertTrue($changeStream->valid());
380382
}
381383

382-
public function testResumeAfterKillThenNoOperations()
384+
public function testRewindResumesAfterCursorNotFound()
383385
{
384386
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], ['maxAwaitTimeMS' => 100]);
385387
$changeStream = $operation->execute($this->getPrimaryServer());
386388

387-
$this->insertDocument(['_id' => 1, 'x' => 'foo']);
388-
389389
$this->killChangeStreamCursor($changeStream);
390390

391391
$changeStream->rewind();
392392
$this->assertFalse($changeStream->valid());
393393
$this->assertNull($changeStream->current());
394394
}
395395

396-
public function testResumeAfterKillThenOperation()
396+
public function testRewindExtractsResumeTokenAndNextResumes()
397397
{
398398
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], ['maxAwaitTimeMS' => 100]);
399399
$changeStream = $operation->execute($this->getPrimaryServer());

0 commit comments

Comments
 (0)