diff options
Diffstat (limited to 'tests/Wallabag')
-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'); |