Skip to content

Commit 448ec9d

Browse files
committed
Skip CSFLE automatic encryption tests for non-enterprise servers
Remove isEnterprise helper
1 parent b3607d9 commit 448ec9d

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

tests/DocumentationExamplesTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,9 +1821,7 @@ public function testQueryableEncryption(): void
18211821
$this->markTestSkipped('Explicit encryption tests require MongoDB 7.0 or later');
18221822
}
18231823

1824-
if (! $this->isEnterprise()) {
1825-
$this->markTestSkipped('Automatic encryption requires MongoDB Enterprise');
1826-
}
1824+
$this->skipIfClientSideEncryptionIsNotSupported();
18271825

18281826
// Fetch names for the database and collection under test
18291827
$collectionName = $this->getCollectionName();

tests/FunctionalTestCase.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use function filter_var;
2929
use function getenv;
3030
use function implode;
31-
use function in_array;
3231
use function is_array;
3332
use function is_callable;
3433
use function is_object;
@@ -397,20 +396,6 @@ protected function isApiVersionRequired(): bool
397396
return isset($document->requireApiVersion) && $document->requireApiVersion === true;
398397
}
399398

400-
protected function isEnterprise(): bool
401-
{
402-
$buildInfo = $this->getPrimaryServer()->executeCommand(
403-
$this->getDatabaseName(),
404-
new Command(['buildInfo' => 1])
405-
)->toArray()[0];
406-
407-
if (isset($buildInfo->modules) && is_array($buildInfo->modules)) {
408-
return in_array('enterprise', $buildInfo->modules);
409-
}
410-
411-
throw new UnexpectedValueException('Could not determine server modules');
412-
}
413-
414399
protected function isLoadBalanced()
415400
{
416401
return $this->getPrimaryServer()->getType() == Server::TYPE_LOAD_BALANCER;

tests/SpecTests/ClientSideEncryption/Prose21_AutomaticDataEncryptionKeysTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public function setUp(): void
3131
{
3232
parent::setUp();
3333

34+
$this->skipIfClientSideEncryptionIsNotSupported();
35+
3436
if ($this->isStandalone() || ($this->isShardedCluster() && ! $this->isShardedClusterUsingReplicasets())) {
3537
$this->markTestSkipped('Automatic data encryption key tests require replica sets');
3638
}

0 commit comments

Comments
 (0)