diff options
Diffstat (limited to 'tests/api/controllers')
-rw-r--r-- | tests/api/controllers/links/PostLinkTest.php | 8 |
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']); |