X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FHistoryTest.php;h=fb633e79105112189b65c98f75f041137f058707;hb=b1baca99f280570d0336b4d71ad1f9dca213a35b;hp=e9e61032efb71ef23a6af3cf79e37544f3ed445c;hpb=8f60e1206e45e67c96a7630d4ff94e72fe875f09;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/HistoryTest.php b/tests/HistoryTest.php index e9e61032..fb633e79 100644 --- a/tests/HistoryTest.php +++ b/tests/HistoryTest.php @@ -44,12 +44,12 @@ class HistoryTest extends \PHPUnit\Framework\TestCase /** * Not writable history file: raise an exception. - * - * @expectedException Exception - * @expectedExceptionMessage History file isn't readable or writable */ public function testConstructNotWritable() { + $this->expectException(\Exception::class); + $this->expectExceptionMessage('History file isn\'t readable or writable'); + touch(self::$historyFilePath); chmod(self::$historyFilePath, 0440); $history = new History(self::$historyFilePath); @@ -58,12 +58,12 @@ class HistoryTest extends \PHPUnit\Framework\TestCase /** * Not parsable history file: raise an exception. - * - * @expectedException Exception - * @expectedExceptionMessageRegExp /Could not parse history file/ */ public function testConstructNotParsable() { + $this->expectException(\Exception::class); + $this->expectExceptionMessageRegExp('/Could not parse history file/'); + file_put_contents(self::$historyFilePath, 'not parsable'); $history = new History(self::$historyFilePath); // gzinflate generates a warning