コード例 #1
0
 public function test load use the KeyPairManager to load the stored certificates()
 {
     $dummyKeyPair = uniqid();
     $this->mockKeyPairManager->loadKeyPair($this->dummyStoragePath . '/public.pem', $this->dummyStoragePath . '/private.pem')->shouldBeCalled()->willReturn($dummyKeyPair);
     $result = $this->service->load();
     $this->assertSame($dummyKeyPair, $result);
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 /**
  * Gets the existing keyPair.
  *
  * @return KeyPair
  */
 public function getKeyPair()
 {
     return $this->storage->load();
 }