X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FApiBundle%2FController%2FDeveloperControllerTest.php;h=5586c70d0b4afce6051eb0c60950a8bab5c17ebf;hb=5419a8368ebb4b4d57f481b842f1fcc576c9149d;hp=f58d1c12027f9bb5a6e259311f8b9ca19206832d;hpb=3a696280075af753fc57ad1a0a6ca3636ef0255d;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php index f58d1c12..5586c70d 100644 --- a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php @@ -56,6 +56,20 @@ class DeveloperControllerTest extends WallabagCoreTestCase $this->assertArrayHasKey('refresh_token', $data); } + public function testCreateTokenWithBadClientId() + { + $client = $this->getClient(); + $client->request('POST', '/oauth/v2/token', [ + 'grant_type' => 'password', + 'client_id' => '$WALLABAG_CLIENT_ID', + 'client_secret' => 'secret', + 'username' => 'admin', + 'password' => 'mypassword', + ]); + + $this->assertSame(400, $client->getResponse()->getStatusCode()); + } + public function testListingClient() { $this->logInAs('admin'); @@ -121,7 +135,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase { $client = $this->getClient(); $em = $client->getContainer()->get('doctrine.orm.entity_manager'); - $userManager = $client->getContainer()->get('fos_user.user_manager'); + $userManager = $client->getContainer()->get('fos_user.user_manager.test'); $user = $userManager->findUserBy(['username' => $username]); $apiClient = new Client($user); $apiClient->setName('My app');