Fix deprecated method in tests

This commit is contained in:
Jeremy Benoist
2020-06-15 13:37:50 +02:00
parent 7332d1f4e5
commit 732ec8a2eb
44 changed files with 314 additions and 326 deletions

View File

@ -23,18 +23,15 @@ class CryptoProxyTest extends TestCase
$records = $logHandler->getRecords();
$this->assertCount(2, $records);
$this->assertContains('Crypto: crypting value', $records[0]['message']);
$this->assertContains('Crypto: decrypting value', $records[1]['message']);
$this->assertStringContainsString('Crypto: crypting value', $records[0]['message']);
$this->assertStringContainsString('Crypto: decrypting value', $records[1]['message']);
}
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage Decrypt fail
*
* @return [type] [description]
*/
public function testDecryptBadValue()
{
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('Decrypt fail');
$crypto = new CryptoProxy(sys_get_temp_dir() . '/' . uniqid('', true) . '.txt', new NullLogger());
$crypto->decrypt('badvalue');
}