aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HistoryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/HistoryTest.php')
-rw-r--r--tests/HistoryTest.php12
1 files changed, 6 insertions, 6 deletions
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
44 44
45 /** 45 /**
46 * Not writable history file: raise an exception. 46 * Not writable history file: raise an exception.
47 *
48 * @expectedException Exception
49 * @expectedExceptionMessage History file isn't readable or writable
50 */ 47 */
51 public function testConstructNotWritable() 48 public function testConstructNotWritable()
52 { 49 {
50 $this->expectException(\Exception::class);
51 $this->expectExceptionMessage('History file isn\'t readable or writable');
52
53 touch(self::$historyFilePath); 53 touch(self::$historyFilePath);
54 chmod(self::$historyFilePath, 0440); 54 chmod(self::$historyFilePath, 0440);
55 $history = new History(self::$historyFilePath); 55 $history = new History(self::$historyFilePath);
@@ -58,12 +58,12 @@ class HistoryTest extends \PHPUnit\Framework\TestCase
58 58
59 /** 59 /**
60 * Not parsable history file: raise an exception. 60 * Not parsable history file: raise an exception.
61 *
62 * @expectedException Exception
63 * @expectedExceptionMessageRegExp /Could not parse history file/
64 */ 61 */
65 public function testConstructNotParsable() 62 public function testConstructNotParsable()
66 { 63 {
64 $this->expectException(\Exception::class);
65 $this->expectExceptionMessageRegExp('/Could not parse history file/');
66
67 file_put_contents(self::$historyFilePath, 'not parsable'); 67 file_put_contents(self::$historyFilePath, 'not parsable');
68 $history = new History(self::$historyFilePath); 68 $history = new History(self::$historyFilePath);
69 // gzinflate generates a warning 69 // gzinflate generates a warning