X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FApiBundle%2FController%2FDeveloperControllerTest.php;h=e3d6929065a6acd55f2d19f3cab7ad0193f4a4f5;hb=3a08e81969e9deafdb4d1aa890c03d67adcc4897;hp=090155d79294d03c38405068042bd799bf9e615b;hpb=102f57941ebfd03899760f8add0701952b4d982f;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php index 090155d7..e3d69290 100644 --- a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php @@ -30,7 +30,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); $this->assertGreaterThan(\count($nbClients), \count($newNbClients)); - $this->assertGreaterThan(1, $alert = $crawler->filter('.settings ul li strong')->extract(['_text'])); + $this->assertGreaterThan(1, $alert = $crawler->filter('.settings table strong')->extract(['_text'])); $this->assertContains('My app', $alert[0]); } @@ -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');