Exemplo n.º 1
0
 /**
  * @covers ::__construct
  * @covers ::reveal
  */
 public function testMaskingStringLongerThanNoiseLength()
 {
     $noise = SecretKey::getKey();
     $noise_length = mb_strlen($noise, '8bit');
     $string = str_repeat('asdf', $noise_length);
     $secret = new Secret($string);
     $this->assertSame($string, $secret->reveal(), 'Secret was destroyed');
 }
Exemplo n.º 2
0
 /**
  * @covers ::getKey
  */
 public function testGetKey()
 {
     $this->assertInternalType('string', SecretKey::getKey());
 }
Exemplo n.º 3
0
 /**
  * @return string The original secret
  */
 public function reveal() : string
 {
     return $this->mask($this->value, SecretKey::getKey());
 }