Commit db792015 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-454: Skip startAtOperationTime test if unsupported

parent c3e6dc30
...@@ -21,6 +21,8 @@ use ReflectionClass; ...@@ -21,6 +21,8 @@ use ReflectionClass;
class WatchFunctionalTest extends FunctionalTestCase class WatchFunctionalTest extends FunctionalTestCase
{ {
private static $wireVersionForStartAtOperationTime = 7;
private $defaultOptions = ['maxAwaitTimeMS' => 500]; private $defaultOptions = ['maxAwaitTimeMS' => 500];
public function setUp() public function setUp()
...@@ -134,6 +136,8 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -134,6 +136,8 @@ class WatchFunctionalTest extends FunctionalTestCase
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime() public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime()
{ {
$this->skipIfStartAtOperationTimeNotSupported();
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions); $operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions);
$operationTime = null; $operationTime = null;
...@@ -944,4 +948,11 @@ class WatchFunctionalTest extends FunctionalTestCase ...@@ -944,4 +948,11 @@ class WatchFunctionalTest extends FunctionalTestCase
$operation = new DatabaseCommand($this->getDatabaseName(), $command); $operation = new DatabaseCommand($this->getDatabaseName(), $command);
$operation->execute($this->getPrimaryServer()); $operation->execute($this->getPrimaryServer());
} }
private function skipIfStartAtOperationTimeNotSupported()
{
if (!\MongoDB\server_supports_feature($this->getPrimaryServer(), self::$wireVersionForStartAtOperationTime)) {
$this->markTestSkipped('Operation time is not supported');
}
}
} }
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