public function EncryptServiceTest::testLoadEncryptionMethods in Encrypt 8.3
Tests loadEncryptionMethods method.
@covers ::__construct @covers ::loadEncryptionMethods
File
- tests/
src/ Unit/ EncryptServiceTest.php, line 100
Class
- EncryptServiceTest
- Unit tests for EncryptService class.
Namespace
Drupal\Tests\encrypt\UnitCode
public function testLoadEncryptionMethods() {
$definitions = [
'test_encryption_method' => [
'id' => 'test_encryption_method',
'title' => "Test encryption method",
],
];
$this->encryptManager
->getDefinitions()
->willReturn($definitions);
$service = new EncryptService($this->encryptManager
->reveal(), $this->keyRepository
->reveal(), $this
->getConfigFactoryStub($this->defaultConfig));
$methods = $service
->loadEncryptionMethods();
$this
->assertEquals([
'test_encryption_method',
], array_keys($methods));
}