diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-27 14:07:08 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-09-27 14:09:55 +0200 |
commit | b1baca99f280570d0336b4d71ad1f9dca213a35b (patch) | |
tree | 518de2057da549d0baa982c6aa689aa813377774 /tests/legacy/LegacyUpdaterTest.php | |
parent | 8f60e1206e45e67c96a7630d4ff94e72fe875f09 (diff) | |
download | Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.tar.gz Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.tar.zst Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.zip |
Convert legacy PHPUnit @expected* to new ->expect*
Converted automatically using https://github.com/ArthurHoaro/convert-legacy-phpunit-expect
Diffstat (limited to 'tests/legacy/LegacyUpdaterTest.php')
-rw-r--r-- | tests/legacy/LegacyUpdaterTest.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/legacy/LegacyUpdaterTest.php b/tests/legacy/LegacyUpdaterTest.php index 9b693dcb..acfac530 100644 --- a/tests/legacy/LegacyUpdaterTest.php +++ b/tests/legacy/LegacyUpdaterTest.php | |||
@@ -82,10 +82,11 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase | |||
82 | * Test errors in UpdaterUtils::write_updates_file(): empty updates file. | 82 | * Test errors in UpdaterUtils::write_updates_file(): empty updates file. |
83 | * | 83 | * |
84 | * @expectedException Exception | 84 | * @expectedException Exception |
85 | * @expectedExceptionMessageRegExp /Updates file path is not set(.*)/ | ||
86 | */ | 85 | */ |
87 | public function testWriteEmptyUpdatesFile() | 86 | public function testWriteEmptyUpdatesFile() |
88 | { | 87 | { |
88 | $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); | ||
89 | |||
89 | UpdaterUtils::write_updates_file('', array('test')); | 90 | UpdaterUtils::write_updates_file('', array('test')); |
90 | } | 91 | } |
91 | 92 | ||
@@ -93,10 +94,11 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase | |||
93 | * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. | 94 | * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. |
94 | * | 95 | * |
95 | * @expectedException Exception | 96 | * @expectedException Exception |
96 | * @expectedExceptionMessageRegExp /Unable to write(.*)/ | ||
97 | */ | 97 | */ |
98 | public function testWriteUpdatesFileNotWritable() | 98 | public function testWriteUpdatesFileNotWritable() |
99 | { | 99 | { |
100 | $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); | ||
101 | |||
100 | $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; | 102 | $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; |
101 | touch($updatesFile); | 103 | touch($updatesFile); |
102 | chmod($updatesFile, 0444); | 104 | chmod($updatesFile, 0444); |
@@ -161,11 +163,11 @@ class LegacyUpdaterTest extends \PHPUnit\Framework\TestCase | |||
161 | 163 | ||
162 | /** | 164 | /** |
163 | * Test Update failed. | 165 | * Test Update failed. |
164 | * | ||
165 | * @expectedException \Exception | ||
166 | */ | 166 | */ |
167 | public function testUpdateFailed() | 167 | public function testUpdateFailed() |
168 | { | 168 | { |
169 | $this->expectException(\Exception::class); | ||
170 | |||
169 | $updates = array( | 171 | $updates = array( |
170 | 'updateMethodDummy1', | 172 | 'updateMethodDummy1', |
171 | 'updateMethodDummy2', | 173 | 'updateMethodDummy2', |