Skip to content

Commit 106bcd4

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

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
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 & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -397,20 +397,6 @@ protected function isApiVersionRequired(): bool
397397
return isset($document->requireApiVersion) && $document->requireApiVersion === true;
398398
}
399399

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-
414400
protected function isLoadBalanced()
415401
{
416402
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)