X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Flegacy%2FLegacyLinkFilterTest.php;h=9db921a9013cb28b982404e10eb509080756116a;hb=b1baca99f280570d0336b4d71ad1f9dca213a35b;hp=8223cc158f21c0780ce424541fc070587a5c37fd;hpb=8f60e1206e45e67c96a7630d4ff94e72fe875f09;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/legacy/LegacyLinkFilterTest.php b/tests/legacy/LegacyLinkFilterTest.php index 8223cc15..9db921a9 100644 --- a/tests/legacy/LegacyLinkFilterTest.php +++ b/tests/legacy/LegacyLinkFilterTest.php @@ -198,20 +198,22 @@ class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase /** * Use an invalid date format * @expectedException Exception - * @expectedExceptionMessageRegExp /Invalid date format/ */ public function testFilterInvalidDayWithChars() { + $this->expectExceptionMessageRegExp('/Invalid date format/'); + self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, 'Rainy day, dream away'); } /** * Use an invalid date format * @expectedException Exception - * @expectedExceptionMessageRegExp /Invalid date format/ */ public function testFilterInvalidDayDigits() { + $this->expectExceptionMessageRegExp('/Invalid date format/'); + self::$linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, '20'); } @@ -235,11 +237,11 @@ class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase /** * No link for this hash - * - * @expectedException \Shaarli\Bookmark\Exception\BookmarkNotFoundException */ public function testFilterUnknownSmallHash() { + $this->expectException(\Shaarli\Bookmark\Exception\BookmarkNotFoundException::class); + self::$linkFilter->filter(LegacyLinkFilter::$FILTER_HASH, 'Iblaah'); }