Skip to content

Commit a7a8a7f

Browse files
author
Michael Pohl
committed
bearer->Bearer
1 parent 49955df commit a7a8a7f

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

lib/OAuth2.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class OAuth2 implements IOAuth2
158158

159159
/**
160160
* Used to define the name of the OAuth access token parameter
161-
* (POST & GET). This is for the "bearer" token type.
161+
* (POST & GET). This is for the "Bearer" token type.
162162
* Other token types may use different methods and names.
163163
*
164164
* IETF Draft section 2 specifies that it should be called "access_token"

tests/OAuth2OutputTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testGrantAccessTokenWithGrantAuthCodeSuccess()
3535
$response = $this->fixture->grantAccessToken($request);
3636

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

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

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

6464
// Utility methods

tests/OAuth2Test.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function testGrantAccessTokenWithClientCredentialsSuccess()
215215
$response = $this->fixture->grantAccessToken($request);
216216

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

221221
/**
@@ -424,7 +424,7 @@ public function testGrantAccessTokenWithGrantUser()
424424
array('date' => null)
425425
));
426426

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

429429
$token = $stub->getLastAccessToken();
430430
$this->assertSame('cid', $token->getClientId());
@@ -489,7 +489,7 @@ public function testGrantAccessTokenWithGrantUserWithScope()
489489
array('date' => null)
490490
));
491491

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

494494
$token = $stub->getLastAccessToken();
495495
$this->assertSame('cid', $token->getClientId());
@@ -523,7 +523,7 @@ public function testGrantAccessTokenWithGrantUserWithReducedScope()
523523
array('date' => null)
524524
));
525525

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

528528
$token = $stub->getLastAccessToken();
529529
$this->assertSame('cid', $token->getClientId());
@@ -556,7 +556,7 @@ public function testGrantAccessTokenWithGrantUserWithNoScope()
556556
array('date' => null)
557557
));
558558

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

561561
$token = $stub->getLastAccessToken();
562562
$this->assertSame('cid', $token->getClientId());
@@ -643,7 +643,7 @@ public function testGrantAccessTokenWithGrantExtension()
643643
array('date' => null)
644644
));
645645

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

649649
/**
@@ -679,7 +679,7 @@ public function testGrantAccessTokenWithGrantExtensionLimitedLifetime()
679679
array('date' => null)
680680
));
681681

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

685685
/**
@@ -716,7 +716,7 @@ public function testGrantAccessTokenWithGrantExtensionJwtBearer()
716716
array('date' => null)
717717
));
718718

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

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

0 commit comments

Comments
 (0)