aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/links/GetLinkIdTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api/controllers/links/GetLinkIdTest.php')
-rw-r--r--tests/api/controllers/links/GetLinkIdTest.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/api/controllers/links/GetLinkIdTest.php b/tests/api/controllers/links/GetLinkIdTest.php
index 8bb81dc8..99dc606f 100644
--- a/tests/api/controllers/links/GetLinkIdTest.php
+++ b/tests/api/controllers/links/GetLinkIdTest.php
@@ -20,7 +20,7 @@ use Slim\Http\Response;
20 * 20 *
21 * @package Shaarli\Api\Controllers 21 * @package Shaarli\Api\Controllers
22 */ 22 */
23class GetLinkIdTest extends \PHPUnit\Framework\TestCase 23class GetLinkIdTest extends \Shaarli\TestCase
24{ 24{
25 /** 25 /**
26 * @var string datastore to test write operations 26 * @var string datastore to test write operations
@@ -55,7 +55,7 @@ class GetLinkIdTest extends \PHPUnit\Framework\TestCase
55 /** 55 /**
56 * Before each test, instantiate a new Api with its config, plugins and bookmarks. 56 * Before each test, instantiate a new Api with its config, plugins and bookmarks.
57 */ 57 */
58 public function setUp() 58 protected function setUp(): void
59 { 59 {
60 $this->conf = new ConfigManager('tests/utils/config/configJson'); 60 $this->conf = new ConfigManager('tests/utils/config/configJson');
61 $this->conf->set('resource.datastore', self::$testDatastore); 61 $this->conf->set('resource.datastore', self::$testDatastore);
@@ -74,7 +74,7 @@ class GetLinkIdTest extends \PHPUnit\Framework\TestCase
74 /** 74 /**
75 * After each test, remove the test datastore. 75 * After each test, remove the test datastore.
76 */ 76 */
77 public function tearDown() 77 protected function tearDown(): void
78 { 78 {
79 @unlink(self::$testDatastore); 79 @unlink(self::$testDatastore);
80 } 80 }
@@ -120,12 +120,12 @@ class GetLinkIdTest extends \PHPUnit\Framework\TestCase
120 120
121 /** 121 /**
122 * Test basic getLink service: get non existent link => ApiLinkNotFoundException. 122 * Test basic getLink service: get non existent link => ApiLinkNotFoundException.
123 *
124 * @expectedException Shaarli\Api\Exceptions\ApiLinkNotFoundException
125 * @expectedExceptionMessage Link not found
126 */ 123 */
127 public function testGetLink404() 124 public function testGetLink404()
128 { 125 {
126 $this->expectException(\Shaarli\Api\Exceptions\ApiLinkNotFoundException::class);
127 $this->expectExceptionMessage('Link not found');
128
129 $env = Environment::mock([ 129 $env = Environment::mock([
130 'REQUEST_METHOD' => 'GET', 130 'REQUEST_METHOD' => 'GET',
131 ]); 131 ]);