KeyRepositoryUnavailableTest.php in Akamai 8.3
File
tests/src/Kernel/KeyRepositoryUnavailableTest.php
View source
<?php
namespace Drupal\Tests\akamai\Kernel;
use Drupal\KernelTests\KernelTestBase;
class KeyRepositoryUnavailableTest extends KernelTestBase {
public static $modules = [
'akamai',
];
protected function setUp() {
parent::setUp();
$this
->installConfig([
'akamai',
]);
}
public function testHasKeyRepositoryIsFalse() {
$this
->assertFalse($this->container
->get('akamai.key_provider')
->hasKeyRepository());
}
public function testKeyProviderGetKeysThrowsException() {
$this
->expectException(\Exception::class);
$keys = $this->container
->get('akamai.key_provider')
->getKeys();
}
public function testKeyProviderGetKeyThrowsException() {
$this
->expectException(\Exception::class);
$keys = $this->container
->get('akamai.key_provider')
->getKey('some key');
}
}