コード例 #1
0
 public function test exists asserts every file exists()
 {
     $dummySuccess = rand(0, 1) === 1;
     $this->mockFilesystem->exists([$this->dummyStoragePath . '/public.pem', $this->dummyStoragePath . '/private.pem'])->willReturn($dummySuccess);
     $result = $this->service->exists();
     $this->assertSame($dummySuccess, $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
 /**
  * Returns whether or not a keyPair exists.
  *
  * @return bool
  */
 public function hasKeyPair()
 {
     return $this->storage->exists();
 }