X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fapi%2Fcontrollers%2Flinks%2FPostLinkTest.php;h=e12f803be3ce99004294b926e4e14dd7b98f0ba1;hb=dff039092d180fffa89e7d88f7a4b7bc24dfc80f;hp=7ff92f5c96968c6e12c75098dc164526c0a3224d;hpb=29c31b7ec6ca48ba37b7eb6da650931fd0cb7164;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/api/controllers/links/PostLinkTest.php b/tests/api/controllers/links/PostLinkTest.php index 7ff92f5c..e12f803b 100644 --- a/tests/api/controllers/links/PostLinkTest.php +++ b/tests/api/controllers/links/PostLinkTest.php @@ -92,8 +92,8 @@ class PostLinkTest extends TestCase $mock = $this->createMock(Router::class); $mock->expects($this->any()) - ->method('relativePathFor') - ->willReturn('api/v1/bookmarks/1'); + ->method('pathFor') + ->willReturn('/api/v1/bookmarks/1'); // affect @property-read... seems to work $this->controller->getCi()->router = $mock; @@ -128,7 +128,7 @@ class PostLinkTest extends TestCase $response = $this->controller->postLink($request, new Response()); $this->assertEquals(201, $response->getStatusCode()); - $this->assertEquals('api/v1/bookmarks/1', $response->getHeader('Location')[0]); + $this->assertEquals('/api/v1/bookmarks/1', $response->getHeader('Location')[0]); $data = json_decode((string) $response->getBody(), true); $this->assertEquals(self::NB_FIELDS_LINK, count($data)); $this->assertEquals(43, $data['id']); @@ -175,7 +175,7 @@ class PostLinkTest extends TestCase $response = $this->controller->postLink($request, new Response()); $this->assertEquals(201, $response->getStatusCode()); - $this->assertEquals('api/v1/bookmarks/1', $response->getHeader('Location')[0]); + $this->assertEquals('/api/v1/bookmarks/1', $response->getHeader('Location')[0]); $data = json_decode((string) $response->getBody(), true); $this->assertEquals(self::NB_FIELDS_LINK, count($data)); $this->assertEquals(43, $data['id']);