コード例 #1
0
 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);
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 public function test storeKeyPair stores the given keyPair()
 {
     $dummyKeyPair = $this->prophesize(KeyPair::class)->reveal();
     $this->mockStorage->store($dummyKeyPair)->shouldBeCalled();
     $this->service->storeKeyPair($dummyKeyPair);
 }
コード例 #4
0
 /**
  * Store the given keyPair.
  *
  * @param KeyPair $keyPair
  */
 public function storeKeyPair(KeyPair $keyPair)
 {
     $this->storage->store($keyPair);
 }