Skip to content

Commit

Permalink
bearer->Bearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Pohl committed Aug 6, 2019
1 parent 49955df commit a7a8a7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/OAuth2.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class OAuth2 implements IOAuth2

/**
* Used to define the name of the OAuth access token parameter
* (POST & GET). This is for the "bearer" token type.
* (POST & GET). This is for the "Bearer" token type.
* Other token types may use different methods and names.
*
* IETF Draft section 2 specifies that it should be called "access_token"
Expand Down
4 changes: 2 additions & 2 deletions tests/OAuth2OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testGrantAccessTokenWithGrantAuthCodeSuccess()
$response = $this->fixture->grantAccessToken($request);

// Successful token grant will return a JSON encoded token:
$this->assertRegExp('/{"access_token":".*","expires_in":\d+,"token_type":"bearer"/', $response->getContent());
$this->assertRegExp('/{"access_token":".*","expires_in":\d+,"token_type":"Bearer"/', $response->getContent());
}

/**
Expand All @@ -58,7 +58,7 @@ public function testGrantAccessTokenWithGrantAuthCodeSuccessWithoutRedirect()
$response = $this->fixture->grantAccessToken($request);

// Successful token grant will return a JSON encoded token:
$this->assertRegExp('/{"access_token":".*","expires_in":\d+,"token_type":"bearer"/', $response->getContent());
$this->assertRegExp('/{"access_token":".*","expires_in":\d+,"token_type":"Bearer"/', $response->getContent());
}

// Utility methods
Expand Down
16 changes: 8 additions & 8 deletions tests/OAuth2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function testGrantAccessTokenWithClientCredentialsSuccess()
$response = $this->fixture->grantAccessToken($request);

// Successful token grant will return a JSON encoded token WITHOUT a refresh token:
$this->assertRegExp('/^{"access_token":"[^"]+","expires_in":[^"]+,"token_type":"bearer","scope":null}$/', $response->getContent());
$this->assertRegExp('/^{"access_token":"[^"]+","expires_in":[^"]+,"token_type":"Bearer","scope":null}$/', $response->getContent());
}

/**
Expand Down Expand Up @@ -424,7 +424,7 @@ public function testGrantAccessTokenWithGrantUser()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":null}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"Bearer","scope":null}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -489,7 +489,7 @@ public function testGrantAccessTokenWithGrantUserWithScope()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1 scope2"}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"Bearer","scope":"scope1 scope2"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -523,7 +523,7 @@ public function testGrantAccessTokenWithGrantUserWithReducedScope()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1"}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"Bearer","scope":"scope1"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -556,7 +556,7 @@ public function testGrantAccessTokenWithGrantUserWithNoScope()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":"scope1 scope2"}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"Bearer","scope":"scope1 scope2"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down Expand Up @@ -643,7 +643,7 @@ public function testGrantAccessTokenWithGrantExtension()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer"}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"Bearer"}', $response->getContent());
}

/**
Expand Down Expand Up @@ -679,7 +679,7 @@ public function testGrantAccessTokenWithGrantExtensionLimitedLifetime()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":86400,"token_type":"bearer"}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":86400,"token_type":"Bearer"}', $response->getContent());
}

/**
Expand Down Expand Up @@ -716,7 +716,7 @@ public function testGrantAccessTokenWithGrantExtensionJwtBearer()
array('date' => null)
));

$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"bearer","scope":null,"refresh_token":"[^"]+"}', $response->getContent());
$this->assertRegExp('{"access_token":"[^"]+","expires_in":3600,"token_type":"Bearer","scope":null,"refresh_token":"[^"]+"}', $response->getContent());

$token = $stub->getLastAccessToken();
$this->assertSame('cid', $token->getClientId());
Expand Down

0 comments on commit a7a8a7f

Please sign in to comment.