public function test getOrCreateKeyPair does not creates a KeyPair when it exists()
 {
     $dummyKeyPair = $this->prophesize(KeyPair::class)->reveal();
     $this->mockStorage->exists()->willReturn(true);
     $this->mockManager->generateKeyPair()->shouldNotBeCalled();
     $this->mockStorage->load()->shouldBeCalled()->willReturn($dummyKeyPair);
     $this->service->getOrCreateKeyPair();
 }
Exemplo n.º 2
0
 /**
  * Creates a new keyPair.
  */
 public function createKeyPair()
 {
     $this->logger->info('Generating new KeyPair in {storageLocation}', ['storageLocation' => $this->storage->getRootPath()]);
     $this->storeKeyPair($this->manager->generateKeyPair());
 }