Skip to content

Commit db79201

Browse files
committed
PHPLIB-454: Skip startAtOperationTime test if unsupported
1 parent c3e6dc3 commit db79201

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Operation/WatchFunctionalTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
class WatchFunctionalTest extends FunctionalTestCase
2323
{
24+
private static $wireVersionForStartAtOperationTime = 7;
25+
2426
private $defaultOptions = ['maxAwaitTimeMS' => 500];
2527

2628
public function setUp()
@@ -134,6 +136,8 @@ function(array $event) use (&$commands) {
134136

135137
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime()
136138
{
139+
$this->skipIfStartAtOperationTimeNotSupported();
140+
137141
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions);
138142

139143
$operationTime = null;
@@ -944,4 +948,11 @@ private function killChangeStreamCursor(ChangeStream $changeStream)
944948
$operation = new DatabaseCommand($this->getDatabaseName(), $command);
945949
$operation->execute($this->getPrimaryServer());
946950
}
951+
952+
private function skipIfStartAtOperationTimeNotSupported()
953+
{
954+
if (!\MongoDB\server_supports_feature($this->getPrimaryServer(), self::$wireVersionForStartAtOperationTime)) {
955+
$this->markTestSkipped('Operation time is not supported');
956+
}
957+
}
947958
}

0 commit comments

Comments
 (0)