diff options
Diffstat (limited to 'vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service')
-rw-r--r-- | vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Fake.php | 32 | ||||
-rw-r--r-- | vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Mock.php | 58 |
2 files changed, 0 insertions, 90 deletions
diff --git a/vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Fake.php b/vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Fake.php deleted file mode 100644 index d8de2b00..00000000 --- a/vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Fake.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace OAuthTest\Mocks\OAuth2\Service; - -use OAuth\OAuth2\Service\AbstractService; - -class Fake extends AbstractService -{ - const SCOPE_FOO = 'https://www.pieterhordijk.com/auth'; - const SCOPE_CUSTOM = 'custom'; - - /** - * {@inheritdoc} - */ - public function getAuthorizationEndpoint() - { - } - - /** - * {@inheritdoc} - */ - public function getAccessTokenEndpoint() - { - } - - /** - * {@inheritdoc} - */ - protected function parseAccessTokenResponse($responseBody) - { - } -} diff --git a/vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Mock.php b/vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Mock.php deleted file mode 100644 index 508aea00..00000000 --- a/vendor/lusitanian/oauth/tests/Mocks/OAuth2/Service/Mock.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -namespace OAuthTest\Mocks\OAuth2\Service; - -use OAuth\OAuth2\Service\AbstractService; -use OAuth\Common\Http\Uri\Uri; -use OAuth\OAuth2\Token\StdOAuth2Token; - -class Mock extends AbstractService -{ - const SCOPE_MOCK = 'mock'; - const SCOPE_MOCK_2 = 'mock2'; - - private $authorizationMethod = null; - - public function getAuthorizationEndpoint() - { - return new Uri('http://pieterhordijk.com/auth'); - } - - public function getAccessTokenEndpoint() - { - return new Uri('http://pieterhordijk.com/access'); - } - - protected function parseAccessTokenResponse($responseBody) - { - return new StdOAuth2Token(); - } - - // this allows us to set different auth methods for tests - public function setAuthorizationMethod($method) - { - $this->authorizationMethod = $method; - } - - /** - * Returns a class constant from ServiceInterface defining the authorization method used for the API - * Header is the sane default. - * - * @return int - */ - protected function getAuthorizationMethod() - { - switch($this->authorizationMethod) { - case 'querystring': - return static::AUTHORIZATION_METHOD_QUERY_STRING; - - case 'querystring2': - return static::AUTHORIZATION_METHOD_QUERY_STRING_V2; - - case 'bearer': - return static::AUTHORIZATION_METHOD_HEADER_BEARER; - } - - return parent::getAuthorizationMethod(); - } -} |