aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/tags
diff options
context:
space:
mode:
Diffstat (limited to 'tests/api/controllers/tags')
-rw-r--r--tests/api/controllers/tags/DeleteTagTest.php6
-rw-r--r--tests/api/controllers/tags/GetTagNameTest.php6
-rw-r--r--tests/api/controllers/tags/PutTagTest.php12
3 files changed, 12 insertions, 12 deletions
diff --git a/tests/api/controllers/tags/DeleteTagTest.php b/tests/api/controllers/tags/DeleteTagTest.php
index b0980572..0d991b85 100644
--- a/tests/api/controllers/tags/DeleteTagTest.php
+++ b/tests/api/controllers/tags/DeleteTagTest.php
@@ -150,12 +150,12 @@ class DeleteTagTest extends \PHPUnit\Framework\TestCase
150 150
151 /** 151 /**
152 * Test DELETE tag endpoint: reach not existing tag. 152 * Test DELETE tag endpoint: reach not existing tag.
153 *
154 * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException
155 * @expectedExceptionMessage Tag not found
156 */ 153 */
157 public function testDeleteLink404() 154 public function testDeleteLink404()
158 { 155 {
156 $this->expectException(\Shaarli\Api\Exceptions\ApiTagNotFoundException::class);
157 $this->expectExceptionMessage('Tag not found');
158
159 $tagName = 'nopenope'; 159 $tagName = 'nopenope';
160 $tags = $this->bookmarkService->bookmarksCountPerTag(); 160 $tags = $this->bookmarkService->bookmarksCountPerTag();
161 $this->assertFalse(isset($tags[$tagName])); 161 $this->assertFalse(isset($tags[$tagName]));
diff --git a/tests/api/controllers/tags/GetTagNameTest.php b/tests/api/controllers/tags/GetTagNameTest.php
index f8ee10d9..a2fb89ab 100644
--- a/tests/api/controllers/tags/GetTagNameTest.php
+++ b/tests/api/controllers/tags/GetTagNameTest.php
@@ -117,12 +117,12 @@ class GetTagNameTest extends \PHPUnit\Framework\TestCase
117 117
118 /** 118 /**
119 * Test basic getTag service: get non existent tag => ApiTagNotFoundException. 119 * Test basic getTag service: get non existent tag => ApiTagNotFoundException.
120 *
121 * @expectedException Shaarli\Api\Exceptions\ApiTagNotFoundException
122 * @expectedExceptionMessage Tag not found
123 */ 120 */
124 public function testGetTag404() 121 public function testGetTag404()
125 { 122 {
123 $this->expectException(\Shaarli\Api\Exceptions\ApiTagNotFoundException::class);
124 $this->expectExceptionMessage('Tag not found');
125
126 $env = Environment::mock([ 126 $env = Environment::mock([
127 'REQUEST_METHOD' => 'GET', 127 'REQUEST_METHOD' => 'GET',
128 ]); 128 ]);
diff --git a/tests/api/controllers/tags/PutTagTest.php b/tests/api/controllers/tags/PutTagTest.php
index e0bc8663..0845dce1 100644
--- a/tests/api/controllers/tags/PutTagTest.php
+++ b/tests/api/controllers/tags/PutTagTest.php
@@ -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 ]);