X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fbookmark%2FBookmarkFilterTest.php;h=752631a5610be8f5e64f82ff1b24d0e293fa9a70;hb=f4ea7cd5633773a0f6438a1d50dbb70eeacf2f04;hp=91e139c20e283ad59982001ce04064fcfcccaa41;hpb=6f199ee48906ca8cdc7d7f2cacbd4c57f474c879;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/bookmark/BookmarkFilterTest.php b/tests/bookmark/BookmarkFilterTest.php index 91e139c2..752631a5 100644 --- a/tests/bookmark/BookmarkFilterTest.php +++ b/tests/bookmark/BookmarkFilterTest.php @@ -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'); }