Skip to content

Commit ecb5538

Browse files
committed
PHPLIB-466: Improve transaction detection logic
1 parent fd44011 commit ecb5538

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/FunctionalTestCase.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,16 @@ protected function skipIfTransactionsAreNotSupported()
384384
$this->markTestSkipped('Transactions are not supported on standalone servers');
385385
}
386386

387-
// TODO: MongoDB 4.2 should support sharded clusters (see: PHPLIB-374)
388387
if ($this->isShardedCluster()) {
389-
$this->markTestSkipped('Transactions are not supported on sharded clusters');
388+
if (! $this->isShardedClusterUsingReplicasets()) {
389+
$this->markTestSkipped('Transactions are not supported on sharded clusters without replica sets');
390+
}
391+
392+
if (version_compare($this->getFeatureCompatibilityVersion(), '4.2', '<')) {
393+
$this->markTestSkipped('Transactions are only supported on FCV 4.2 or higher');
394+
}
395+
396+
return;
390397
}
391398

392399
if (version_compare($this->getFeatureCompatibilityVersion(), '4.0', '<')) {

0 commit comments

Comments
 (0)