diff options
Diffstat (limited to 'tests/api/controllers/tags/PutTagTest.php')
-rw-r--r-- | tests/api/controllers/tags/PutTagTest.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php index 2a3cc15a..0845dce1 100644 --- a/tests/api/controllers/tags/PutTagTest.php +++ b/tests/api/controllers/tags/PutTagTest.php | |||
@@ -62,7 +62,7 @@ class PutTagTest extends \PHPUnit\Framework\TestCase | |||
62 | /** | 62 | /** |
63 | * Before every test, instantiate a new Api with its config, plugins and bookmarks. | 63 | * Before every test, instantiate a new Api with its config, plugins and bookmarks. |
64 | */ | 64 | */ |
65 | public function setUp() | 65 | protected function setUp(): void |
66 | { | 66 | { |
67 | $this->conf = new ConfigManager('tests/utils/config/configJson'); | 67 | $this->conf = new ConfigManager('tests/utils/config/configJson'); |
68 | $this->conf->set('resource.datastore', self::$testDatastore); | 68 | $this->conf->set('resource.datastore', self::$testDatastore); |
@@ -84,7 +84,7 @@ class PutTagTest extends \PHPUnit\Framework\TestCase | |||
84 | /** | 84 | /** |
85 | * After every test, remove the test datastore. | 85 | * After every test, remove the test datastore. |
86 | */ | 86 | */ |
87 | public function tearDown() | 87 | protected function tearDown(): void |
88 | { | 88 | { |
89 | @unlink(self::$testDatastore); | 89 | @unlink(self::$testDatastore); |
90 | @unlink(self::$testHistory); | 90 | @unlink(self::$testHistory); |
@@ -159,12 +159,12 @@ class PutTagTest extends \PHPUnit\Framework\TestCase | |||
159 | 159 | ||
160 | /** | 160 | /** |
161 | * Test tag update with an empty new tag name => ApiBadParametersException | 161 | * Test tag update with an empty new tag name => ApiBadParametersException |
162 | * | ||
163 | * @expectedException Shaarli\Api\Exceptions\ApiBadParametersException | ||
164 | * @expectedExceptionMessage New tag name is required in the request body | ||
165 | */ | 162 | */ |
166 | public function testPutTagEmpty() | 163 | public function testPutTagEmpty() |
167 | { | 164 | { |
165 | $this->expectException(\Shaarli\Api\Exceptions\ApiBadParametersException::class); | ||
166 | $this->expectExceptionMessage('New tag name is required in the request body'); | ||
167 | |||
168 | $tagName = 'gnu'; | 168 | $tagName = 'gnu'; |
169 | $newName = ''; | 169 | $newName = ''; |
170 | 170 | ||
@@ -194,12 +194,12 @@ class PutTagTest extends \PHPUnit\Framework\TestCase | |||
194 | 194 | ||
195 | /** | 195 | /** |
196 | * Test tag update on non existent tag => ApiTagNotFoundException. | 196 | * Test tag update on non existent tag => ApiTagNotFoundException. |
197 | * | ||
198 | * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException | ||
199 | * @expectedExceptionMessage Tag not found | ||
200 | */ | 197 | */ |
201 | public function testPutTag404() | 198 | public function testPutTag404() |
202 | { | 199 | { |
200 | $this->expectException(\Shaarli\Api\Exceptions\ApiTagNotFoundException::class); | ||
201 | $this->expectExceptionMessage('Tag not found'); | ||
202 | |||
203 | $env = Environment::mock([ | 203 | $env = Environment::mock([ |
204 | 'REQUEST_METHOD' => 'PUT', | 204 | 'REQUEST_METHOD' => 'PUT', |
205 | ]); | 205 | ]); |