You are here

public function OAuth2ServerTestCase::testPasswordGrantType in OAuth2 Server 7

Tests the "User credentials" grant type.

File

tests/oauth2_server.test, line 331
OAuth2 tests.

Class

OAuth2ServerTestCase
Test basic API.

Code

public function testPasswordGrantType() {
  $result = $this
    ->passwordGrantRequest();
  $this
    ->assertEqual($result->code, 200, 'The token request completed successfully');
  $response = json_decode($result->data);
  $this
    ->assertTokenResponse($response);
}