crypt('test'); $decrypted = $crypto->decrypt($crypted); $this->assertSame('test', $decrypted); $records = $logHandler->getRecords(); $this->assertCount(2, $records); $this->assertContains('Crypto: crypting value', $records[0]['message']); $this->assertContains('Crypto: decrypting value', $records[1]['message']); } /** * @expectedException \RuntimeException * @expectedExceptionMessage Decrypt fail * * @return [type] [description] */ public function testDecryptBadValue() { $crypto = new CryptoProxy(sys_get_temp_dir() . '/' . uniqid('', true) . '.txt', new NullLogger()); $crypto->decrypt('badvalue'); } }