public function test storeKeyPair register the client then store the keypair() { $dummyKeyPair = $this->prophesize(KeyPair::class)->reveal(); $mockClient = $this->prophesize(AcmeClient::class); $mockClient->registerAccount($this->dummyContactEmail)->shouldBeCalled(); $this->mockClientFactory->createAcmeClient($dummyKeyPair)->shouldBeCalled()->willReturn($mockClient->reveal()); $this->mockStorage->store($dummyKeyPair)->shouldBeCalled(); $this->service->storeKeyPair($dummyKeyPair); }
public function test store dump each certificate() { $dummyPrivateKey = uniqid(); $dummyPublicKey = uniqid(); $mockKeyPair = $this->prophesize(KeyPair::class); $mockKeyPair->getPublicKeyAsPEM()->shouldBeCalled()->willReturn($dummyPublicKey); $mockKeyPair->getPrivateKeyAsPEM()->shouldBeCalled()->willReturn($dummyPrivateKey); $this->mockFilesystem->dumpFile($this->dummyStoragePath . '/public.pem', $dummyPublicKey)->shouldBeCalled(); $this->mockFilesystem->dumpFile($this->dummyStoragePath . '/private.pem', $dummyPrivateKey)->shouldBeCalled(); $this->service->store($mockKeyPair->reveal()); }
public function test storeKeyPair stores the given keyPair() { $dummyKeyPair = $this->prophesize(KeyPair::class)->reveal(); $this->mockStorage->store($dummyKeyPair)->shouldBeCalled(); $this->service->storeKeyPair($dummyKeyPair); }
/** * Store the given keyPair. * * @param KeyPair $keyPair */ public function storeKeyPair(KeyPair $keyPair) { $this->storage->store($keyPair); }