]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
Merge pull request #4058 from wallabag/feature/copy-client-info
[github/wallabag/wallabag.git] / tests / Wallabag / ApiBundle / Controller / DeveloperControllerTest.php
index 090155d79294d03c38405068042bd799bf9e615b..e3d6929065a6acd55f2d19f3cab7ad0193f4a4f5 100644 (file)
@@ -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');