aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-07-09 21:22:28 +0200
committerGitHub <noreply@github.com>2017-07-09 21:22:28 +0200
commit337e807297fb9700407ce6e4c4f7c307b4dae22c (patch)
treebfcade5d680f6958e52335510ab302262bc8d570 /tests
parentb5d7eb148c4cd62ff187b08765f0c13c7d330fcf (diff)
parent2e5b2fa808ca2793705069e56a3cc7e6631f9d9d (diff)
downloadwallabag-337e807297fb9700407ce6e4c4f7c307b4dae22c.tar.gz
wallabag-337e807297fb9700407ce6e4c4f7c307b4dae22c.tar.zst
wallabag-337e807297fb9700407ce6e4c4f7c307b4dae22c.zip
Merge pull request #3267 from wallabag/revert-client-credentials
Revert client_credentials grant types
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php22
1 files changed, 1 insertions, 21 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
index 2caeccf5..e9e5ee3b 100644
--- a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
@@ -34,7 +34,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
34 $this->assertContains('My app', $alert[0]); 34 $this->assertContains('My app', $alert[0]);
35 } 35 }
36 36
37 public function testCreateTokenFromPasswords() 37 public function testCreateToken()
38 { 38 {
39 $client = $this->getClient(); 39 $client = $this->getClient();
40 $apiClient = $this->createApiClientForUser('admin'); 40 $apiClient = $this->createApiClientForUser('admin');
@@ -56,26 +56,6 @@ class DeveloperControllerTest extends WallabagCoreTestCase
56 $this->assertArrayHasKey('refresh_token', $data); 56 $this->assertArrayHasKey('refresh_token', $data);
57 } 57 }
58 58
59 public function testCreateTokenFromClientCredentialsOnly()
60 {
61 $client = $this->getClient();
62 $apiClient = $this->createApiClientForUser('admin', ['client_credentials']);
63
64 $client->request('POST', '/oauth/v2/token', [
65 'grant_type' => 'client_credentials',
66 'client_id' => $apiClient->getPublicId(),
67 'client_secret' => $apiClient->getSecret(),
68 ]);
69
70 $this->assertSame(200, $client->getResponse()->getStatusCode());
71
72 $data = json_decode($client->getResponse()->getContent(), true);
73 $this->assertArrayHasKey('access_token', $data);
74 $this->assertArrayHasKey('expires_in', $data);
75 $this->assertArrayHasKey('token_type', $data);
76 // Client Credentials created-clients have no refresh tokens
77 }
78
79 public function testListingClient() 59 public function testListingClient()
80 { 60 {
81 $this->logInAs('admin'); 61 $this->logInAs('admin');