X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2Ftags%2FDeleteTagTest.php;h=1326eb47aa7751f20885cb37df764f860097e0f7;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=c67488720b7b2617f8b6b509d1eef4036ed3dd58;hpb=3fb29fdda04ca86e04422d49b86cf646d53c4f9d;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php index c6748872..1326eb47 100644 --- a/tests/api/controllers/tags/DeleteTagTest.php +++ b/tests/api/controllers/tags/DeleteTagTest.php @@ -12,7 +12,7 @@ use Slim\Http\Environment; use Slim\Http\Request; use Slim\Http\Response; -class DeleteTagTest extends \PHPUnit\Framework\TestCase +class DeleteTagTest extends \Shaarli\TestCase { /** * @var string datastore to test write operations @@ -57,7 +57,7 @@ class DeleteTagTest 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); @@ -79,7 +79,7 @@ class DeleteTagTest extends \PHPUnit\Framework\TestCase /** * After each test, remove the test datastore. */ - public function tearDown() + protected function tearDown(): void { @unlink(self::$testDatastore); @unlink(self::$testHistory); @@ -150,12 +150,12 @@ class DeleteTagTest extends \PHPUnit\Framework\TestCase /** * Test DELETE tag endpoint: reach not existing tag. - * - * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException - * @expectedExceptionMessage Tag not found */ public function testDeleteLink404() { + $this->expectException(\Shaarli\Api\Exceptions\ApiTagNotFoundException::class); + $this->expectExceptionMessage('Tag not found'); + $tagName = 'nopenope'; $tags = $this->bookmarkService->bookmarksCountPerTag(); $this->assertFalse(isset($tags[$tagName]));