|
20 | 20 | use function ob_start; |
21 | 21 | use function usleep; |
22 | 22 | use function var_dump; |
23 | | -use function version_compare; |
24 | 23 |
|
25 | 24 | /** |
26 | 25 | * Documentation examples to be parsed for inclusion in the MongoDB manual. |
@@ -1549,9 +1548,7 @@ public function testCausalConsistency(): void |
1549 | 1548 |
|
1550 | 1549 | public function testSnapshotQueries(): void |
1551 | 1550 | { |
1552 | | - if (version_compare($this->getServerVersion(), '5.0.0', '<')) { |
1553 | | - $this->markTestSkipped('Snapshot queries outside of transactions are not supported'); |
1554 | | - } |
| 1551 | + $this->skipIfServerVersion('<', '5.0.0', 'Snapshot queries outside of transactions are not supported'); |
1555 | 1552 |
|
1556 | 1553 | if (! ($this->isReplicaSet() || $this->isShardedClusterUsingReplicasets())) { |
1557 | 1554 | $this->markTestSkipped('Snapshot read concern is only supported with replicasets'); |
@@ -1682,13 +1679,8 @@ public function testVersionedApi(): void |
1682 | 1679 |
|
1683 | 1680 | public function testVersionedApiMigration(): void |
1684 | 1681 | { |
1685 | | - if (version_compare($this->getServerVersion(), '5.0.0', '<')) { |
1686 | | - $this->markTestSkipped('Versioned API is not supported'); |
1687 | | - } |
1688 | | - |
1689 | | - if (version_compare($this->getServerVersion(), '5.0.9', '>=')) { |
1690 | | - $this->markTestSkipped('The count command was added to API version 1 (SERVER-63850)'); |
1691 | | - } |
| 1682 | + $this->skipIfServerVersion('<', '5.0.0', 'Versioned API is not supported'); |
| 1683 | + $this->skipIfServerVersion('>=', '5.0.9', 'The count command was added to API version 1 (SERVER-63850)'); |
1692 | 1684 |
|
1693 | 1685 | $this->dropCollection($this->getDatabaseName(), 'sales'); |
1694 | 1686 | $uriString = static::getUri(true); |
@@ -1817,9 +1809,7 @@ public function testQueryableEncryption(): void |
1817 | 1809 | $this->markTestSkipped('Queryable encryption requires replica sets'); |
1818 | 1810 | } |
1819 | 1811 |
|
1820 | | - if (version_compare($this->getServerVersion(), '7.0.0', '<')) { |
1821 | | - $this->markTestSkipped('Explicit encryption tests require MongoDB 7.0 or later'); |
1822 | | - } |
| 1812 | + $this->skipIfServerVersion('<', '7.0.0', 'Explicit encryption tests require MongoDB 7.0 or later'); |
1823 | 1813 |
|
1824 | 1814 | if (! $this->isEnterprise()) { |
1825 | 1815 | $this->markTestSkipped('Automatic encryption requires MongoDB Enterprise'); |
|
0 commit comments