Skip to content

Commit 5a3d018

Browse files
committed
PHPLIB-446: Skip tests that modify resume token for server 4.1.8+
1 parent 8d84292 commit 5a3d018

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/Operation/WatchFunctionalTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ public function testInitialCursorIsNotClosed()
398398

399399
public function testNextResumeTokenNotFound()
400400
{
401+
if (version_compare($this->getServerVersion(), '4.1.8', '>=')) {
402+
$this->markTestSkipped('Server rejects change streams that modify resume token (SERVER-37786)');
403+
}
404+
401405
$pipeline = [['$project' => ['_id' => 0 ]]];
402406

403407
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, $this->defaultOptions);
@@ -414,6 +418,10 @@ public function testNextResumeTokenNotFound()
414418

415419
public function testRewindResumeTokenNotFound()
416420
{
421+
if (version_compare($this->getServerVersion(), '4.1.8', '>=')) {
422+
$this->markTestSkipped('Server rejects change streams that modify resume token (SERVER-37786)');
423+
}
424+
417425
$pipeline = [['$project' => ['_id' => 0 ]]];
418426

419427
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, $this->defaultOptions);
@@ -428,6 +436,10 @@ public function testRewindResumeTokenNotFound()
428436

429437
public function testNextResumeTokenInvalidType()
430438
{
439+
if (version_compare($this->getServerVersion(), '4.1.8', '>=')) {
440+
$this->markTestSkipped('Server rejects change streams that modify resume token (SERVER-37786)');
441+
}
442+
431443
$pipeline = [['$project' => ['_id' => ['$literal' => 'foo']]]];
432444

433445
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, $this->defaultOptions);
@@ -444,6 +456,10 @@ public function testNextResumeTokenInvalidType()
444456

445457
public function testRewindResumeTokenInvalidType()
446458
{
459+
if (version_compare($this->getServerVersion(), '4.1.8', '>=')) {
460+
$this->markTestSkipped('Server rejects change streams that modify resume token (SERVER-37786)');
461+
}
462+
447463
$pipeline = [['$project' => ['_id' => ['$literal' => 'foo']]]];
448464

449465
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, $this->defaultOptions);
@@ -628,6 +644,10 @@ public function testNextAdvancesKey()
628644

629645
public function testResumeTokenNotFoundAdvancesKey()
630646
{
647+
if (version_compare($this->getServerVersion(), '4.1.8', '>=')) {
648+
$this->markTestSkipped('Server rejects change streams that modify resume token (SERVER-37786)');
649+
}
650+
631651
$pipeline = [['$project' => ['_id' => 0 ]]];
632652

633653
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), $pipeline, $this->defaultOptions);

0 commit comments

Comments
 (0)