aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/legacy
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-29 18:41:21 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-29 18:57:25 +0200
commitf447edb73b1bcb52e86286467d3ec7b7bdc29948 (patch)
tree3cd7f6ddc4e227f901fb8bd11d75d6307c713b1a /tests/legacy
parentab58f2542072e6bf34acd862f6cfed84b33feb29 (diff)
downloadShaarli-f447edb73b1bcb52e86286467d3ec7b7bdc29948.tar.gz
Shaarli-f447edb73b1bcb52e86286467d3ec7b7bdc29948.tar.zst
Shaarli-f447edb73b1bcb52e86286467d3ec7b7bdc29948.zip
Fix missing @expectedException convertion
Diffstat (limited to 'tests/legacy')
-rw-r--r--tests/legacy/LegacyLinkDBTest.php3
-rw-r--r--tests/legacy/LegacyLinkFilterTest.php4
-rw-r--r--tests/legacy/LegacyUpdaterTest.php6
3 files changed, 5 insertions, 8 deletions
diff --git a/tests/legacy/LegacyLinkDBTest.php b/tests/legacy/LegacyLinkDBTest.php
index 66746dfc..df2cad62 100644
--- a/tests/legacy/LegacyLinkDBTest.php
+++ b/tests/legacy/LegacyLinkDBTest.php
@@ -99,11 +99,10 @@ class LegacyLinkDBTest extends \Shaarli\TestCase
99 99
100 /** 100 /**
101 * Attempt to instantiate a LinkDB whereas the datastore is not writable 101 * Attempt to instantiate a LinkDB whereas the datastore is not writable
102 *
103 * @expectedException Shaarli\Exceptions\IOException
104 */ 102 */
105 public function testConstructDatastoreNotWriteable() 103 public function testConstructDatastoreNotWriteable()
106 { 104 {
105 $this->expectException(\Shaarli\Exceptions\IOException::class);
107 $this->expectExceptionMessageRegExp('/Error accessing "null"/'); 106 $this->expectExceptionMessageRegExp('/Error accessing "null"/');
108 107
109 new LegacyLinkDB('null/store.db', false, false); 108 new LegacyLinkDB('null/store.db', false, false);
diff --git a/tests/legacy/LegacyLinkFilterTest.php b/tests/legacy/LegacyLinkFilterTest.php
index 82bc93d8..45d7754d 100644
--- a/tests/legacy/LegacyLinkFilterTest.php
+++ b/tests/legacy/LegacyLinkFilterTest.php
@@ -197,10 +197,10 @@ class LegacyLinkFilterTest extends \Shaarli\TestCase
197 197
198 /** 198 /**
199 * Use an invalid date format 199 * Use an invalid date format
200 * @expectedException Exception
201 */ 200 */
202 public function testFilterInvalidDayWithChars() 201 public function testFilterInvalidDayWithChars()
203 { 202 {
203 $this->expectException(\Exception::class);
204 $this->expectExceptionMessageRegExp('/Invalid date format/'); 204 $this->expectExceptionMessageRegExp('/Invalid date format/');
205 205
206 self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, 'Rainy day, dream away'); 206 self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, 'Rainy day, dream away');
@@ -208,10 +208,10 @@ class LegacyLinkFilterTest extends \Shaarli\TestCase
208 208
209 /** 209 /**
210 * Use an invalid date format 210 * Use an invalid date format
211 * @expectedException Exception
212 */ 211 */
213 public function testFilterInvalidDayDigits() 212 public function testFilterInvalidDayDigits()
214 { 213 {
214 $this->expectException(\Exception::class);
215 $this->expectExceptionMessageRegExp('/Invalid date format/'); 215 $this->expectExceptionMessageRegExp('/Invalid date format/');
216 216
217 self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, '20'); 217 self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, '20');
diff --git a/tests/legacy/LegacyUpdaterTest.php b/tests/legacy/LegacyUpdaterTest.php
index 0ddcb4a6..f7391b86 100644
--- a/tests/legacy/LegacyUpdaterTest.php
+++ b/tests/legacy/LegacyUpdaterTest.php
@@ -80,11 +80,10 @@ class LegacyUpdaterTest extends \Shaarli\TestCase
80 80
81 /** 81 /**
82 * Test errors in UpdaterUtils::write_updates_file(): empty updates file. 82 * Test errors in UpdaterUtils::write_updates_file(): empty updates file.
83 *
84 * @expectedException Exception
85 */ 83 */
86 public function testWriteEmptyUpdatesFile() 84 public function testWriteEmptyUpdatesFile()
87 { 85 {
86 $this->expectException(\Exception::class);
88 $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/'); 87 $this->expectExceptionMessageRegExp('/Updates file path is not set(.*)/');
89 88
90 UpdaterUtils::write_updates_file('', array('test')); 89 UpdaterUtils::write_updates_file('', array('test'));
@@ -92,11 +91,10 @@ class LegacyUpdaterTest extends \Shaarli\TestCase
92 91
93 /** 92 /**
94 * Test errors in UpdaterUtils::write_updates_file(): not writable updates file. 93 * Test errors in UpdaterUtils::write_updates_file(): not writable updates file.
95 *
96 * @expectedException Exception
97 */ 94 */
98 public function testWriteUpdatesFileNotWritable() 95 public function testWriteUpdatesFileNotWritable()
99 { 96 {
97 $this->expectException(\Exception::class);
100 $this->expectExceptionMessageRegExp('/Unable to write(.*)/'); 98 $this->expectExceptionMessageRegExp('/Unable to write(.*)/');
101 99
102 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt'; 100 $updatesFile = $this->conf->get('resource.data_dir') . '/updates.txt';