diff --git a/src/League/OAuth2/Server/Exception/MissingAccessTokenException.php b/src/League/OAuth2/Server/Exception/MissingAccessTokenException.php new file mode 100644 index 00000000..7bc3fe83 --- /dev/null +++ b/src/League/OAuth2/Server/Exception/MissingAccessTokenException.php @@ -0,0 +1,20 @@ + + * @copyright Copyright (c) 2014 PHP League of Extraordinary Packages + * @license http://mit-license.org/ + * @link http://github.com/php-loep/oauth2-server + */ + +namespace League\OAuth2\Server\Exception; + +/** + * MissingAccessToken Exception + */ +class MissingAccessTokenException extends OAuth2Exception +{ + +} diff --git a/src/League/OAuth2/Server/Resource.php b/src/League/OAuth2/Server/Resource.php index 3485315a..eb48ac5e 100644 --- a/src/League/OAuth2/Server/Resource.php +++ b/src/League/OAuth2/Server/Resource.php @@ -4,7 +4,8 @@ * * @package php-loep/oauth2-server * @author Alex Bilbie - * @copyright Copyright (c) 2013 PHP League of Extraordinary Packages + * @author Woody Gilk + * @copyright Copyright (c) 2013-2014 PHP League of Extraordinary Packages * @license http://mit-license.org/ * @link http://github.com/php-loep/oauth2-server */ @@ -274,7 +275,7 @@ class Resource } if (empty($accessToken)) { - throw new Exception\InvalidAccessTokenException('Access token is missing'); + throw new Exception\MissingAccessTokenException('Access token is missing'); } return $accessToken; diff --git a/tests/resource/ResourceServerTest.php b/tests/resource/ResourceServerTest.php index aee81b52..b25b89be 100644 --- a/tests/resource/ResourceServerTest.php +++ b/tests/resource/ResourceServerTest.php @@ -66,7 +66,7 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase } /** - * @expectedException League\OAuth2\Server\Exception\InvalidAccessTokenException + * @expectedException League\OAuth2\Server\Exception\MissingAccessTokenException */ public function test_determineAccessToken_missingToken() { @@ -84,7 +84,7 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase } /** - * @expectedException League\OAuth2\Server\Exception\InvalidAccessTokenException + * @expectedException League\OAuth2\Server\Exception\MissingAccessTokenException */ public function test_determineAccessToken_brokenCurlRequest() {