コード例 #1
0
 public function test createAcmeClient use CA configuration()
 {
     $keyPair = $this->prophesize(KeyPair::class)->reveal();
     $this->mockCA->getBaseUri()->shouldBeCalled();
     $this->mockCA->getAgreement()->shouldBeCalled();
     $client = $this->service->createAcmeClient($keyPair);
     $this->assertInstanceOf(AcmeClient::class, $client);
 }
コード例 #2
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);
 }
コード例 #3
0
 /**
  * Register the new keyPair to the Certificate Authority.
  *
  * @param KeyPair $keyPair
  */
 public function register(KeyPair $keyPair)
 {
     $client = $this->clientFactory->createAcmeClient($keyPair);
     $client->registerAccount($this->contactEmail);
     $this->logger->notice('Account {contactEmail} registered', ['contactEmail' => $this->contactEmail]);
 }