aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/links
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-27 14:07:08 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-27 14:09:55 +0200
commitb1baca99f280570d0336b4d71ad1f9dca213a35b (patch)
tree518de2057da549d0baa982c6aa689aa813377774 /tests/api/controllers/links
parent8f60e1206e45e67c96a7630d4ff94e72fe875f09 (diff)
downloadShaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.tar.gz
Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.tar.zst
Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.zip
Convert legacy PHPUnit @expected* to new ->expect*
Converted automatically using https://github.com/ArthurHoaro/convert-legacy-phpunit-expect
Diffstat (limited to 'tests/api/controllers/links')
-rw-r--r--tests/api/controllers/links/DeleteLinkTest.php4
-rw-r--r--tests/api/controllers/links/GetLinkIdTest.php6
-rw-r--r--tests/api/controllers/links/PutLinkTest.php6
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/api/controllers/links/DeleteLinkTest.php b/tests/api/controllers/links/DeleteLinkTest.php
index 10dfe8bc..bd8403cf 100644
--- a/tests/api/controllers/links/DeleteLinkTest.php
+++ b/tests/api/controllers/links/DeleteLinkTest.php
@@ -113,11 +113,11 @@ class DeleteLinkTest extends \PHPUnit\Framework\TestCase
113 113
114 /** 114 /**
115 * Test DELETE link endpoint: reach not existing ID. 115 * Test DELETE link endpoint: reach not existing ID.
116 *
117 * @expectedException \Shaarli\Api\Exceptions\ApiLinkNotFoundException
118 */ 116 */
119 public function testDeleteLink404() 117 public function testDeleteLink404()
120 { 118 {
119 $this->expectException(\Shaarli\Api\Exceptions\ApiLinkNotFoundException::class);
120
121 $id = -1; 121 $id = -1;
122 $this->assertFalse($this->bookmarkService->exists($id)); 122 $this->assertFalse($this->bookmarkService->exists($id));
123 $env = Environment::mock([ 123 $env = Environment::mock([
diff --git a/tests/api/controllers/links/GetLinkIdTest.php b/tests/api/controllers/links/GetLinkIdTest.php
index ee42e259..3a3aaa7b 100644
--- a/tests/api/controllers/links/GetLinkIdTest.php
+++ b/tests/api/controllers/links/GetLinkIdTest.php
@@ -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 ]);
diff --git a/tests/api/controllers/links/PutLinkTest.php b/tests/api/controllers/links/PutLinkTest.php
index f582a2b5..3d62a1b1 100644
--- a/tests/api/controllers/links/PutLinkTest.php
+++ b/tests/api/controllers/links/PutLinkTest.php
@@ -218,12 +218,12 @@ class PutLinkTest extends \PHPUnit\Framework\TestCase
218 218
219 /** 219 /**
220 * Test link update on non existent link => ApiLinkNotFoundException. 220 * Test link update on non existent link => ApiLinkNotFoundException.
221 *
222 * @expectedException Shaarli\Api\Exceptions\ApiLinkNotFoundException
223 * @expectedExceptionMessage Link not found
224 */ 221 */
225 public function testGetLink404() 222 public function testGetLink404()
226 { 223 {
224 $this->expectException(\Shaarli\Api\Exceptions\ApiLinkNotFoundException::class);
225 $this->expectExceptionMessage('Link not found');
226
227 $env = Environment::mock([ 227 $env = Environment::mock([
228 'REQUEST_METHOD' => 'PUT', 228 'REQUEST_METHOD' => 'PUT',
229 ]); 229 ]);