X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Flegacy%2FLegacyLinkFilterTest.php;h=82bc93d8f9a235b9056832555feb9fffe2924470;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=8223cc158f21c0780ce424541fc070587a5c37fd;hpb=8f60e1206e45e67c96a7630d4ff94e72fe875f09;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/legacy/LegacyLinkFilterTest.php b/tests/legacy/LegacyLinkFilterTest.php index 8223cc15..82bc93d8 100644 --- a/tests/legacy/LegacyLinkFilterTest.php +++ b/tests/legacy/LegacyLinkFilterTest.php @@ -10,7 +10,7 @@ use Shaarli\Legacy\LegacyLinkFilter; /** * Class LegacyLinkFilterTest. */ -class LegacyLinkFilterTest extends \PHPUnit\Framework\TestCase +class LegacyLinkFilterTest extends \Shaarli\TestCase { /** * @var string Test datastore path. @@ -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'); }