コード例 #1
0
ファイル: SecretTest.php プロジェクト: firehed/security
 /**
  * @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');
 }
コード例 #2
0
ファイル: SecretKeyTest.php プロジェクト: firehed/security
 /**
  * @covers ::getKey
  */
 public function testGetKey()
 {
     $this->assertInternalType('string', SecretKey::getKey());
 }
コード例 #3
0
ファイル: Secret.php プロジェクト: firehed/security
 /**
  * @return string The original secret
  */
 public function reveal() : string
 {
     return $this->mask($this->value, SecretKey::getKey());
 }