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(); }
/** * Creates a new keyPair. */ public function createKeyPair() { $this->logger->info('Generating new KeyPair in {storageLocation}', ['storageLocation' => $this->storage->getRootPath()]); $this->storeKeyPair($this->manager->generateKeyPair()); }