aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers
diff options
context:
space:
mode:
authorLoïc Carr <zizou.xena@gmail.com>2020-10-28 19:57:40 -0700
committerLoïc Carr <zizou.xena@gmail.com>2020-10-28 20:08:18 -0700
commitb37ca790729125fa0df956220a4062f1d34c57e7 (patch)
tree15c758ef4acc7a6dff56a4cae28ce94fc0d3543e /tests/api/controllers
parent78c2f122e067f8bab62deb7ef758708721f4a9ba (diff)
downloadShaarli-b37ca790729125fa0df956220a4062f1d34c57e7.tar.gz
Shaarli-b37ca790729125fa0df956220a4062f1d34c57e7.tar.zst
Shaarli-b37ca790729125fa0df956220a4062f1d34c57e7.zip
postLink: change relative path to absolute path
Diffstat (limited to 'tests/api/controllers')
-rw-r--r--tests/api/controllers/links/PostLinkTest.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php
index b2dd09eb..969b9fd9 100644
--- a/tests/api/controllers/links/PostLinkTest.php
+++ b/tests/api/controllers/links/PostLinkTest.php
@@ -90,8 +90,8 @@ class PostLinkTest extends TestCase
90 90
91 $mock = $this->createMock(Router::class); 91 $mock = $this->createMock(Router::class);
92 $mock->expects($this->any()) 92 $mock->expects($this->any())
93 ->method('relativePathFor') 93 ->method('pathFor')
94 ->willReturn('api/v1/bookmarks/1'); 94 ->willReturn('/api/v1/bookmarks/1');
95 95
96 // affect @property-read... seems to work 96 // affect @property-read... seems to work
97 $this->controller->getCi()->router = $mock; 97 $this->controller->getCi()->router = $mock;
@@ -126,7 +126,7 @@ class PostLinkTest extends TestCase
126 126
127 $response = $this->controller->postLink($request, new Response()); 127 $response = $this->controller->postLink($request, new Response());
128 $this->assertEquals(201, $response->getStatusCode()); 128 $this->assertEquals(201, $response->getStatusCode());
129 $this->assertEquals('api/v1/bookmarks/1', $response->getHeader('Location')[0]); 129 $this->assertEquals('/api/v1/bookmarks/1', $response->getHeader('Location')[0]);
130 $data = json_decode((string) $response->getBody(), true); 130 $data = json_decode((string) $response->getBody(), true);
131 $this->assertEquals(self::NB_FIELDS_LINK, count($data)); 131 $this->assertEquals(self::NB_FIELDS_LINK, count($data));
132 $this->assertEquals(43, $data['id']); 132 $this->assertEquals(43, $data['id']);
@@ -171,7 +171,7 @@ class PostLinkTest extends TestCase
171 $response = $this->controller->postLink($request, new Response()); 171 $response = $this->controller->postLink($request, new Response());
172 172
173 $this->assertEquals(201, $response->getStatusCode()); 173 $this->assertEquals(201, $response->getStatusCode());
174 $this->assertEquals('api/v1/bookmarks/1', $response->getHeader('Location')[0]); 174 $this->assertEquals('/api/v1/bookmarks/1', $response->getHeader('Location')[0]);
175 $data = json_decode((string) $response->getBody(), true); 175 $data = json_decode((string) $response->getBody(), true);
176 $this->assertEquals(self::NB_FIELDS_LINK, count($data)); 176 $this->assertEquals(self::NB_FIELDS_LINK, count($data));
177 $this->assertEquals(43, $data['id']); 177 $this->assertEquals(43, $data['id']);