@@ -706,7 +706,7 @@ public function testNextAdvancesKey()
706
706
$ this ->assertSame (1 , $ changeStream ->key ());
707
707
}
708
708
709
- public function testResumeTokenNotFoundAdvancesKey ()
709
+ public function testResumeTokenNotFoundDoesNotAdvanceKey ()
710
710
{
711
711
if (version_compare ($ this ->getServerVersion (), '4.1.8 ' , '>= ' )) {
712
712
$ this ->markTestSkipped ('Server rejects change streams that modify resume token (SERVER-37786) ' );
@@ -717,8 +717,6 @@ public function testResumeTokenNotFoundAdvancesKey()
717
717
$ operation = new Watch ($ this ->manager , $ this ->getDatabaseName (), $ this ->getCollectionName (), $ pipeline , $ this ->defaultOptions );
718
718
$ changeStream = $ operation ->execute ($ this ->getPrimaryServer ());
719
719
720
- /* Note: we intentionally do not start iteration with rewind() to ensure
721
- * that we test extraction functionality within next(). */
722
720
$ this ->insertDocument (['x ' => 1 ]);
723
721
$ this ->insertDocument (['x ' => 2 ]);
724
722
$ this ->insertDocument (['x ' => 3 ]);
@@ -735,14 +733,14 @@ public function testResumeTokenNotFoundAdvancesKey()
735
733
$ this ->fail ('ResumeTokenException was not thrown ' );
736
734
} catch (ResumeTokenException $ e ) {}
737
735
738
- $ this ->assertSame (1 , $ changeStream ->key ());
736
+ $ this ->assertSame (0 , $ changeStream ->key ());
739
737
740
738
try {
741
739
$ changeStream ->next ();
742
740
$ this ->fail ('ResumeTokenException was not thrown ' );
743
741
} catch (ResumeTokenException $ e ) {}
744
742
745
- $ this ->assertSame (2 , $ changeStream ->key ());
743
+ $ this ->assertSame (0 , $ changeStream ->key ());
746
744
}
747
745
748
746
public function testSessionPersistsAfterResume ()
0 commit comments