public function test createKeyPairStorage returns an instance of CertificateStorage()
 {
     $domain = uniqid();
     $result = $this->service->createKeyPairStorage($domain);
     $this->assertInstanceOf(KeyPairStorage::class, $result);
     $reflection = new \ReflectionObject($result);
     $storagePathProperty = $reflection->getProperty('storagePath');
     $storagePathProperty->setAccessible(true);
     $this->assertSame($this->dummyStoragePath . '/' . $domain, $storagePathProperty->getValue($result));
 }
 public function test createKeyPairProvider injects the logger()
 {
     $dummyDomain = uniqid();
     $dummyStorage = $this->prophesize(KeyPairStorage::class)->reveal();
     $dummyLogger = $this->prophesize(LoggerInterface::class)->reveal();
     $this->mockStorageFactory->createKeyPairStorage($dummyDomain)->shouldBeCalled()->willReturn($dummyStorage);
     $this->service->setLogger($dummyLogger);
     $provider = $this->service->createKeyPairProvider($dummyDomain);
     $reflection = new \ReflectionObject($provider);
     $loggerProperty = $reflection->getProperty('logger');
     $loggerProperty->setAccessible(true);
     $this->assertSame($dummyLogger, $loggerProperty->getValue($provider));
 }
 /**
  * Create a new instance of KeyPairProvider for the given domain.
  *
  * @param string $domain
  *
  * @return KeyPairProvider
  */
 public function createKeyPairProvider($domain)
 {
     $provider = new KeyPairProvider($this->keyPairManager, $this->storageFactory->createKeyPairStorage($domain));
     $provider->setLogger($this->logger);
     return $provider;
 }