X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2Flinks%2FDeleteLinkTest.php;h=cf9464f07877e1613ae0b5704ed2a523da23c497;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=6c2b36988c6741128934c3538d14b1496b3cc7b5;hpb=e26e2060f5470ce8bf4c5973284bae07b8af170a;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php index 6c2b3698..cf9464f0 100644 --- a/tests/api/controllers/links/DeleteLinkTest.php +++ b/tests/api/controllers/links/DeleteLinkTest.php @@ -11,7 +11,7 @@ use Slim\Http\Environment; use Slim\Http\Request; use Slim\Http\Response; -class DeleteLinkTest extends \PHPUnit\Framework\TestCase +class DeleteLinkTest extends \Shaarli\TestCase { /** * @var string datastore to test write operations @@ -56,7 +56,7 @@ class DeleteLinkTest extends \PHPUnit\Framework\TestCase /** * Before each test, instantiate a new Api with its config, plugins and bookmarks. */ - public function setUp() + protected function setUp(): void { $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->conf->set('resource.datastore', self::$testDatastore); @@ -78,7 +78,7 @@ class DeleteLinkTest extends \PHPUnit\Framework\TestCase /** * After each test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); @@ -113,11 +113,11 @@ class DeleteLinkTest extends \PHPUnit\Framework\TestCase /** * Test DELETE link endpoint: reach not existing ID. - * - * @expectedException \Shaarli\Api\Exceptions\ApiLinkNotFoundException */ public function testDeleteLink404() { + $this->expectException(\Shaarli\Api\Exceptions\ApiLinkNotFoundException::class); + $id = -1; $this->assertFalse($this->bookmarkService->exists($id)); $env = Environment::mock([