diff options
Diffstat (limited to 'tests/updater')
-rw-r--r-- | tests/updater/UpdaterTest.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/updater/UpdaterTest.php b/tests/updater/UpdaterTest.php index a7dd70bf..5cfcd5db 100644 --- a/tests/updater/UpdaterTest.php +++ b/tests/updater/UpdaterTest.php | |||
@@ -42,7 +42,7 @@ class UpdaterTest extends TestCase | |||
42 | /** | 42 | /** |
43 | * Executed before each test. | 43 | * Executed before each test. |
44 | */ | 44 | */ |
45 | public function setUp() | 45 | protected function setUp(): void |
46 | { | 46 | { |
47 | $this->refDB = new \ReferenceLinkDB(); | 47 | $this->refDB = new \ReferenceLinkDB(); |
48 | $this->refDB->write(self::$testDatastore); | 48 | $this->refDB->write(self::$testDatastore); |
@@ -89,10 +89,11 @@ class UpdaterTest extends TestCase | |||
89 | * Test errors in UpdaterUtils::write_updates_file(): empty updates file. | 89 | * Test errors in UpdaterUtils::write_updates_file(): empty updates file. |
90 | * | 90 | * |
91 | * @expectedException Exception | 91 | * @expectedException Exception |
92 | * @expectedExceptionMessageRegExp /Updates file path is not set(.*)/ | ||
93 | */ | 92 | */ |
94 | public function testWriteEmptyUpdatesFile() | 93 | public function testWriteEmptyUpdatesFile() |
95 | { | 94 | { |
95 | $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); | ||
96 | |||
96 | UpdaterUtils::write_updates_file('', array('test')); | 97 | UpdaterUtils::write_updates_file('', array('test')); |
97 | } | 98 | } |
98 | 99 | ||
@@ -100,10 +101,11 @@ class UpdaterTest extends TestCase | |||
100 | * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. | 101 | * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. |
101 | * | 102 | * |
102 | * @expectedException Exception | 103 | * @expectedException Exception |
103 | * @expectedExceptionMessageRegExp /Unable to write(.*)/ | ||
104 | */ | 104 | */ |
105 | public function testWriteUpdatesFileNotWritable() | 105 | public function testWriteUpdatesFileNotWritable() |
106 | { | 106 | { |
107 | $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); | ||
108 | |||
107 | $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; | 109 | $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; |
108 | touch($updatesFile); | 110 | touch($updatesFile); |
109 | chmod($updatesFile, 0444); | 111 | chmod($updatesFile, 0444); |
@@ -168,11 +170,11 @@ class UpdaterTest extends TestCase | |||
168 | 170 | ||
169 | /** | 171 | /** |
170 | * Test Update failed. | 172 | * Test Update failed. |
171 | * | ||
172 | * @expectedException \Exception | ||
173 | */ | 173 | */ |
174 | public function testUpdateFailed() | 174 | public function testUpdateFailed() |
175 | { | 175 | { |
176 | $this->expectException(\Exception::class); | ||
177 | |||
176 | $updates = array( | 178 | $updates = array( |
177 | 'updateMethodDummy1', | 179 | 'updateMethodDummy1', |
178 | 'updateMethodDummy2', | 180 | 'updateMethodDummy2', |