diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php index 4b8a45c47..d1fd4d5bb 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -17,27 +17,6 @@ use Symfony\Component\Routing\Annotation\Route; class UserApiController extends ApiController { - /** - * @Route( - * "/api/1.0/main/whoami.{_format}", - * name="chill_main_user_whoami", - * requirements={ - * "_format": "json" - * } - * ) - * - * @param mixed $_format - */ - public function whoami($_format): JsonResponse - { - return $this->json( - $this->getUser(), - JsonResponse::HTTP_OK, - [], - ['groups' => ['read']] - ); - } - /** * @Route( * "/api/1.0/main/user-current-location.{_format}", @@ -58,4 +37,25 @@ class UserApiController extends ApiController ['groups' => ['read']] ); } + + /** + * @Route( + * "/api/1.0/main/whoami.{_format}", + * name="chill_main_user_whoami", + * requirements={ + * "_format": "json" + * } + * ) + * + * @param mixed $_format + */ + public function whoami($_format): JsonResponse + { + return $this->json( + $this->getUser(), + JsonResponse::HTTP_OK, + [], + ['groups' => ['read']] + ); + } } diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/UserApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/UserApiControllerTest.php index 5d773972d..d96f9647a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/UserApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/UserApiControllerTest.php @@ -55,14 +55,6 @@ final class UserApiControllerTest extends WebTestCase return $data['results'][0]; } - public function testWhoami() - { - $client = $this->getClientAuthenticated(); - - $client->request(Request::METHOD_GET, '/api/1.0/main/whoami.json'); - - $this->assertResponseIsSuccessful(); - } public function testUserCurrentLocation() { $client = $this->getClientAuthenticated(); @@ -71,4 +63,13 @@ final class UserApiControllerTest extends WebTestCase $this->assertResponseIsSuccessful(); } + + public function testWhoami() + { + $client = $this->getClientAuthenticated(); + + $client->request(Request::METHOD_GET, '/api/1.0/main/whoami.json'); + + $this->assertResponseIsSuccessful(); + } }