diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-08 19:28:12 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-07-08 19:28:12 +0200 |
commit | 2e5b2fa808ca2793705069e56a3cc7e6631f9d9d (patch) | |
tree | bfcade5d680f6958e52335510ab302262bc8d570 /tests/Wallabag/ApiBundle | |
parent | b5d7eb148c4cd62ff187b08765f0c13c7d330fcf (diff) | |
download | wallabag-2e5b2fa808ca2793705069e56a3cc7e6631f9d9d.tar.gz wallabag-2e5b2fa808ca2793705069e56a3cc7e6631f9d9d.tar.zst wallabag-2e5b2fa808ca2793705069e56a3cc7e6631f9d9d.zip |
Revert client_credentials grant types
Diffstat (limited to 'tests/Wallabag/ApiBundle')
-rw-r--r-- | tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php | 22 |
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'); |