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;
class WatchFunctionalTest extends FunctionalTestCase
{
private static $wireVersionForStartAtOperationTime = 7;
private $defaultOptions = ['maxAwaitTimeMS' => 500];
public function setUp()
......@@ -134,6 +136,8 @@ class WatchFunctionalTest extends FunctionalTestCase
public function testResumeBeforeReceivingAnyResultsIncludesStartAtOperationTime()
{
$this->skipIfStartAtOperationTimeNotSupported();
$operation = new Watch($this->manager, $this->getDatabaseName(), $this->getCollectionName(), [], $this->defaultOptions);
$operationTime = null;
......@@ -944,4 +948,11 @@ class WatchFunctionalTest extends FunctionalTestCase
$operation = new DatabaseCommand($this->getDatabaseName(), $command);
$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