|
8 | 8 | use Composer\InstalledVersions; |
9 | 9 | use Composer\Semver\VersionParser; |
10 | 10 | use Doctrine\Bundle\MongoDBBundle\Attribute\MapDocument; |
| 11 | +use Doctrine\Bundle\MongoDBBundle\Command\Encryption\DiagnosticCommand; |
| 12 | +use Doctrine\Bundle\MongoDBBundle\Command\Encryption\DumpFieldsMapCommand; |
11 | 13 | use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass; |
12 | 14 | use Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension; |
13 | 15 | use Doctrine\Bundle\MongoDBBundle\Tests\DependencyInjection\Fixtures\Bundles\DocumentListenerBundle\EventListener\TestAttributeListener; |
@@ -487,6 +489,34 @@ public function testUseTransactionalFlush(): void |
487 | 489 | ); |
488 | 490 | } |
489 | 491 |
|
| 492 | + public function testEncryptionCommands(): void |
| 493 | + { |
| 494 | + self::requireAutoEncryptionSupportInODM(); |
| 495 | + |
| 496 | + $container = $this->buildMinimalContainer(); |
| 497 | + $loader = new DoctrineMongoDBExtension(); |
| 498 | + |
| 499 | + $config = [ |
| 500 | + 'connections' => [ |
| 501 | + 'default' => [ |
| 502 | + 'autoEncryption' => [ |
| 503 | + 'kmsProvider' => ['type' => 'local', 'key' => 'base64_encoded_key'], |
| 504 | + ], |
| 505 | + ], |
| 506 | + ], |
| 507 | + 'document_managers' => ['default' => []], |
| 508 | + ]; |
| 509 | + |
| 510 | + $loader->load([$config], $container); |
| 511 | + (new ServiceRepositoryCompilerPass())->process($container); |
| 512 | + |
| 513 | + $dumpFieldsMapCommand = $container->get('doctrine_mongodb.odm.command.encryption_dump_fields_map'); |
| 514 | + $this->assertInstanceOf(DumpFieldsMapCommand::class, $dumpFieldsMapCommand); |
| 515 | + |
| 516 | + $diagnosticCommand = $container->get('doctrine_mongodb.odm.command.encryption_diagnostic'); |
| 517 | + $this->assertInstanceOf(DiagnosticCommand::class, $diagnosticCommand); |
| 518 | + } |
| 519 | + |
490 | 520 | public function testAutoEncryptionWithKeyVaultClientService(): void |
491 | 521 | { |
492 | 522 | self::requireAutoEncryptionSupportInODM(); |
|
0 commit comments