X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fbookmark%2FBookmarkFilterTest.php;h=2f15cb3c66017f1482748ae409c9102e3f23fe41;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=91e139c20e283ad59982001ce04064fcfcccaa41;hpb=27ddfec3c3847f10ab0de246f4a174b751c5f19e;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/bookmark/BookmarkFilterTest.php b/tests/bookmark/BookmarkFilterTest.php index 91e139c2..2f15cb3c 100644 --- a/tests/bookmark/BookmarkFilterTest.php +++ b/tests/bookmark/BookmarkFilterTest.php @@ -3,10 +3,10 @@ namespace Shaarli\Bookmark; use Exception; -use PHPUnit\Framework\TestCase; use ReferenceLinkDB; use Shaarli\Config\ConfigManager; use Shaarli\History; +use Shaarli\TestCase; /** * Class BookmarkFilterTest. @@ -213,20 +213,22 @@ class BookmarkFilterTest extends TestCase /** * Use an invalid date format * @expectedException Exception - * @expectedExceptionMessageRegExp /Invalid date format/ */ public function testFilterInvalidDayWithChars() { + $this->expectExceptionMessageRegExp('/Invalid date format/'); + self::$linkFilter->filter(BookmarkFilter::$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(BookmarkFilter::$FILTER_DAY, '20'); } @@ -250,11 +252,11 @@ class BookmarkFilterTest extends TestCase /** * No link for this hash - * - * @expectedException \Shaarli\Bookmark\Exception\BookmarkNotFoundException */ public function testFilterUnknownSmallHash() { + $this->expectException(\Shaarli\Bookmark\Exception\BookmarkNotFoundException::class); + self::$linkFilter->filter(BookmarkFilter::$FILTER_HASH, 'Iblaah'); }