namespace Shaarli\Bookmark;
use Exception;
-use PHPUnit\Framework\TestCase;
use ReferenceLinkDB;
use Shaarli\Config\ConfigManager;
use Shaarli\History;
+use Shaarli\TestCase;
/**
* Class BookmarkFilterTest.
/**
* Use an invalid date format
- * @expectedException Exception
- * @expectedExceptionMessageRegExp /Invalid date format/
*/
public function testFilterInvalidDayWithChars()
{
+ $this->expectException(\Exception::class);
+ $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->expectException(\Exception::class);
+ $this->expectExceptionMessageRegExp('/Invalid date format/');
+
self::$linkFilter->filter(BookmarkFilter::$FILTER_DAY, '20');
}
/**
* 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');
}