aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/HistoryTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/HistoryTest.php')
-rw-r--r--tests/HistoryTest.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/HistoryTest.php b/tests/HistoryTest.php
index 79322249..91525845 100644
--- a/tests/HistoryTest.php
+++ b/tests/HistoryTest.php
@@ -21,9 +21,19 @@ class HistoryTest extends PHPUnit_Framework_TestCase
21 /** 21 /**
22 * Test that the history file is created if it doesn't exist. 22 * Test that the history file is created if it doesn't exist.
23 */ 23 */
24 public function testConstructFileCreated() 24 public function testConstructLazyLoading()
25 { 25 {
26 new History(self::$historyFilePath); 26 new History(self::$historyFilePath);
27 $this->assertFileNotExists(self::$historyFilePath);
28 }
29
30 /**
31 * Test that the history file is created if it doesn't exist.
32 */
33 public function testAddEventCreateFile()
34 {
35 $history = new History(self::$historyFilePath);
36 $history->updateSettings();
27 $this->assertFileExists(self::$historyFilePath); 37 $this->assertFileExists(self::$historyFilePath);
28 } 38 }
29 39
@@ -37,7 +47,8 @@ class HistoryTest extends PHPUnit_Framework_TestCase
37 { 47 {
38 touch(self::$historyFilePath); 48 touch(self::$historyFilePath);
39 chmod(self::$historyFilePath, 0440); 49 chmod(self::$historyFilePath, 0440);
40 new History(self::$historyFilePath); 50 $history = new History(self::$historyFilePath);
51 $history->updateSettings();
41 } 52 }
42 53
43 /** 54 /**
@@ -49,8 +60,9 @@ class HistoryTest extends PHPUnit_Framework_TestCase
49 public function testConstructNotParsable() 60 public function testConstructNotParsable()
50 { 61 {
51 file_put_contents(self::$historyFilePath, 'not parsable'); 62 file_put_contents(self::$historyFilePath, 'not parsable');
63 $history = new History(self::$historyFilePath);
52 // gzinflate generates a warning 64 // gzinflate generates a warning
53 @new History(self::$historyFilePath); 65 @$history->updateSettings();
54 } 66 }
55 67
56 /** 68 /**