diff options
Diffstat (limited to 'tests/legacy/LegacyLinkFilterTest.php')
-rw-r--r-- | tests/legacy/LegacyLinkFilterTest.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/legacy/LegacyLinkFilterTest.php b/tests/legacy/LegacyLinkFilterTest.php index ba9ec529..45d7754d 100644 --- a/tests/legacy/LegacyLinkFilterTest.php +++ b/tests/legacy/LegacyLinkFilterTest.php | |||
@@ -10,7 +10,7 @@ use Shaarli\Legacy\LegacyLinkFilter; | |||
10 | /** | 10 | /** |
11 | * Class LegacyLinkFilterTest. | 11 | * Class LegacyLinkFilterTest. |
12 | */ | 12 | */ |
13 | class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase | 13 | class LegacyLinkFilterTest extends \Shaarli\TestCase |
14 | { | 14 | { |
15 | /** | 15 | /** |
16 | * @var string Test datastore path. | 16 | * @var string Test datastore path. |
@@ -34,7 +34,7 @@ class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase | |||
34 | /** | 34 | /** |
35 | * Instantiate linkFilter with ReferenceLinkDB data. | 35 | * Instantiate linkFilter with ReferenceLinkDB data. |
36 | */ | 36 | */ |
37 | public static function setUpBeforeClass() | 37 | public static function setUpBeforeClass(): void |
38 | { | 38 | { |
39 | self::$refDB = new ReferenceLinkDB(true); | 39 | self::$refDB = new ReferenceLinkDB(true); |
40 | self::$refDB->write(self::$testDatastore); | 40 | self::$refDB->write(self::$testDatastore); |
@@ -197,21 +197,23 @@ class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase | |||
197 | 197 | ||
198 | /** | 198 | /** |
199 | * Use an invalid date format | 199 | * Use an invalid date format |
200 | * @expectedException Exception | ||
201 | * @expectedExceptionMessageRegExp /Invalid date format/ | ||
202 | */ | 200 | */ |
203 | public function testFilterInvalidDayWithChars() | 201 | public function testFilterInvalidDayWithChars() |
204 | { | 202 | { |
203 | $this->expectException(\Exception::class); | ||
204 | $this->expectExceptionMessageRegExp('/Invalid date format/'); | ||
205 | |||
205 | self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, 'Rainy day, dream away'); | 206 | self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, 'Rainy day, dream away'); |
206 | } | 207 | } |
207 | 208 | ||
208 | /** | 209 | /** |
209 | * Use an invalid date format | 210 | * Use an invalid date format |
210 | * @expectedException Exception | ||
211 | * @expectedExceptionMessageRegExp /Invalid date format/ | ||
212 | */ | 211 | */ |
213 | public function testFilterInvalidDayDigits() | 212 | public function testFilterInvalidDayDigits() |
214 | { | 213 | { |
214 | $this->expectException(\Exception::class); | ||
215 | $this->expectExceptionMessageRegExp('/Invalid date format/'); | ||
216 | |||
215 | self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, '20'); | 217 | self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, '20'); |
216 | } | 218 | } |
217 | 219 | ||
@@ -235,11 +237,11 @@ class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase | |||
235 | 237 | ||
236 | /** | 238 | /** |
237 | * No link for this hash | 239 | * No link for this hash |
238 | * | ||
239 | * @expectedException \Shaarli\Bookmark\Exception\BookmarkNotFoundException | ||
240 | */ | 240 | */ |
241 | public function testFilterUnknownSmallHash() | 241 | public function testFilterUnknownSmallHash() |
242 | { | 242 | { |
243 | $this->expectException(\Shaarli\Bookmark\Exception\BookmarkNotFoundException::class); | ||
244 | |||
243 | self::$linkFilter->filter(LegacyLinkFilter::$FILTER_HASH, 'Iblaah'); | 245 | self::$linkFilter->filter(LegacyLinkFilter::$FILTER_HASH, 'Iblaah'); |
244 | } | 246 | } |
245 | 247 | ||