/** * Decrypts the given $string that was encrypted with the $key. * * @param string $string Encrypted string. * @param string $key Key used for encryption. * * @return string Decrypted string. */ public function decrypt($string, $key) { return $this->serviceInstance->decrypt($string, $key); }
public function testEncryptDecryptFail() { $crypt = new Crypt(); $encrypted = $crypt->encrypt('test string', 'some key'); $result = $crypt->decrypt($encrypted, 'wrong key'); $this->assertFalse($result); }