X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Flegacy%2FLegacyLinkDBTest.php;h=819bc272a2031877cf47b10c0c57829fa5d4bd29;hb=c3fca560b624588d37508142ab73573caf467573;hp=17b2b0e6cc35d277c87ce9949bfa8a7ee525f27d;hpb=3fb29fdda04ca86e04422d49b86cf646d53c4f9d;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/legacy/LegacyLinkDBTest.php b/tests/legacy/LegacyLinkDBTest.php index 17b2b0e6..819bc272 100644 --- a/tests/legacy/LegacyLinkDBTest.php +++ b/tests/legacy/LegacyLinkDBTest.php @@ -11,7 +11,6 @@ use ReflectionClass; use Shaarli; use Shaarli\Bookmark\Bookmark; -require_once 'application/feed/Cache.php'; require_once 'application/Utils.php'; require_once 'tests/utils/ReferenceLinkDB.php'; @@ -53,7 +52,7 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase * * Resets test data for each test */ - protected function setUp() + protected function setUp(): void { if (file_exists(self::$testDatastore)) { unlink(self::$testDatastore); @@ -102,10 +101,11 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase * Attempt to instantiate a LinkDB whereas the datastore is not writable * * @expectedException Shaarli\Exceptions\IOException - * @expectedExceptionMessageRegExp /Error accessing "null"/ */ public function testConstructDatastoreNotWriteable() { + $this->expectExceptionMessageRegExp('/Error accessing "null"/'); + new LegacyLinkDB('null/store.db', false, false); } @@ -421,22 +421,22 @@ class LegacyLinkDBTest extends \PHPUnit\Framework\TestCase /** * Test filterHash() with an invalid smallhash. - * - * @expectedException \Shaarli\Bookmark\Exception\BookmarkNotFoundException */ public function testFilterHashInValid1() { + $this->expectException(\Shaarli\Bookmark\Exception\BookmarkNotFoundException::class); + $request = 'blabla'; self::$publicLinkDB->filterHash($request); } /** * Test filterHash() with an empty smallhash. - * - * @expectedException \Shaarli\Bookmark\Exception\BookmarkNotFoundException */ public function testFilterHashInValid() { + $this->expectException(\Shaarli\Bookmark\Exception\BookmarkNotFoundException::class); + self::$publicLinkDB->filterHash(''); }