diff --git a/src/League/OAuth2/Server/Authorization.php b/src/League/OAuth2/Server/AuthorizationServer.php similarity index 99% rename from src/League/OAuth2/Server/Authorization.php rename to src/League/OAuth2/Server/AuthorizationServer.php index ad5ff2f5..f43a857e 100644 --- a/src/League/OAuth2/Server/Authorization.php +++ b/src/League/OAuth2/Server/AuthorizationServer.php @@ -28,7 +28,7 @@ use Symfony\Component\HttpFoundation\Request; /** * OAuth 2.0 authorization server class */ -class Authorization extends AbstractServer +class AuthorizationServer extends AbstractServer { /** * The delimeter between scopes specified in the scope query string parameter diff --git a/src/League/OAuth2/Server/Grant/AbstractGrant.php b/src/League/OAuth2/Server/Grant/AbstractGrant.php index e418da61..0efee277 100644 --- a/src/League/OAuth2/Server/Grant/AbstractGrant.php +++ b/src/League/OAuth2/Server/Grant/AbstractGrant.php @@ -11,7 +11,7 @@ namespace League\OAuth2\Server\Grant; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer; use League\OAuth2\Server\Entity\Scope; use League\OAuth2\Server\Exception\ClientException; @@ -92,10 +92,10 @@ abstract class AbstractGrant implements GrantTypeInterface /** * Inject the authorization server into the grant - * @param Authorization $server The authorization server instance + * @param AuthorizationServer $server The authorization server instance * @return self */ - public function setAuthorizationServer(Authorization $server) + public function setAuthorizationServer(AuthorizationServer $server) { $this->server = $server; return $this; diff --git a/tests/Entities/AbstractTokenTest.php b/tests/Entities/AbstractTokenTest.php index 099a05d5..ea85fb16 100644 --- a/tests/Entities/AbstractTokenTest.php +++ b/tests/Entities/AbstractTokenTest.php @@ -5,7 +5,7 @@ namespace LeagueTests\Entities; use LeagueTests\Stubs\StubAbstractToken; use League\OAuth2\Server\Entity\Session; use League\OAuth2\Server\Entity\Scope; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer as Authorization; use \Mockery as M; class AbstractTokenTests extends \PHPUnit_Framework_TestCase diff --git a/tests/Entities/AccessTokenTest.php b/tests/Entities/AccessTokenTest.php index 027fd633..597d7de1 100644 --- a/tests/Entities/AccessTokenTest.php +++ b/tests/Entities/AccessTokenTest.php @@ -5,7 +5,7 @@ namespace LeagueTests\Entities; use League\OAuth2\Server\Entity\Scope; use League\OAuth2\Server\Entity\Session; use League\OAuth2\Server\Entity\AccessToken; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer as Authorization; use \Mockery as M; class AccessTokenTests extends \PHPUnit_Framework_TestCase diff --git a/tests/Entities/RefreshTokenTest.php b/tests/Entities/RefreshTokenTest.php index 067e976c..1cc275b4 100644 --- a/tests/Entities/RefreshTokenTest.php +++ b/tests/Entities/RefreshTokenTest.php @@ -6,7 +6,7 @@ use League\OAuth2\Server\Entity\Scope; use League\OAuth2\Server\Entity\Session; use League\OAuth2\Server\Entity\AccessToken; use League\OAuth2\Server\Entity\RefreshToken; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer as Authorization; use \Mockery as M; class RefreshTokenTests extends \PHPUnit_Framework_TestCase diff --git a/tests/Entities/SessionTest.php b/tests/Entities/SessionTest.php index b9a97490..1e2d1d70 100644 --- a/tests/Entities/SessionTest.php +++ b/tests/Entities/SessionTest.php @@ -8,7 +8,7 @@ use League\OAuth2\Server\Entity\Client; use League\OAuth2\Server\Entity\RefreshToken; use League\OAuth2\Server\Entity\Session; use League\OAuth2\Server\Entity\Scope; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer as Authorization; use \Mockery as M; class SessionTests extends \PHPUnit_Framework_TestCase diff --git a/tests/Grant/AbstractGrantTest.php b/tests/Grant/AbstractGrantTest.php index 41f9a0c7..60b28979 100644 --- a/tests/Grant/AbstractGrantTest.php +++ b/tests/Grant/AbstractGrantTest.php @@ -4,7 +4,7 @@ namespace LeagueTests\Grant; use League\OAuth2\Server\Grant; use League\OAuth2\Server\Entity\Scope; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer; use League\OAuth2\Server\Grant\ClientException; use LeagueTests\Stubs\StubAbstractGrant; use Mockery as M; @@ -13,7 +13,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase { function testSetGet() { - $server = new Authorization; + $server = new AuthorizationServer; $grant = new StubAbstractGrant; $grant->setIdentifier('foobar'); @@ -23,7 +23,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase $this->assertEquals('foobar', $grant->getIdentifier()); $this->assertEquals('foobar', $grant->getResponseType()); $this->assertEquals(300, $grant->getAccessTokenTTL()); - $this->assertTrue($grant->getAuthorizationServer() instanceof Authorization); + $this->assertTrue($grant->getAuthorizationServer() instanceof AuthorizationServer); } public function testFormatScopes() @@ -50,7 +50,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase public function testValidateScopes() { - $server = new Authorization; + $server = new AuthorizationServer; $scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface'); $scopeStorage->shouldReceive('setServer'); @@ -79,7 +79,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase $scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface'); $scopeStorage->shouldReceive('setServer'); - $server = new Authorization; + $server = new AuthorizationServer; $server->requireScopeParam(true); $server->setScopeStorage($scopeStorage); @@ -97,7 +97,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase $scopeStorage->shouldReceive('setServer'); $scopeStorage->shouldReceive('get')->andReturn(null); - $server = new Authorization; + $server = new AuthorizationServer; $server->setScopeStorage($scopeStorage); $grant = new StubAbstractGrant; @@ -108,7 +108,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase public function testValidateScopesDefaultScope() { - $server = new Authorization; + $server = new AuthorizationServer; $scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface'); $scopeStorage->shouldReceive('setServer'); @@ -129,7 +129,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase public function testValidateScopesDefaultScopeArray() { - $server = new Authorization; + $server = new AuthorizationServer; $scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface'); $scopeStorage->shouldReceive('setServer'); diff --git a/tests/Grant/ClientCredentialsTest.php b/tests/Grant/ClientCredentialsTest.php index cb6ee601..cdc74df9 100644 --- a/tests/Grant/ClientCredentialsTest.php +++ b/tests/Grant/ClientCredentialsTest.php @@ -5,7 +5,7 @@ namespace LeagueTests\Grant; use League\OAuth2\Server\Grant\ClientCredentials; use League\OAuth2\Server\Entity\Scope; use League\OAuth2\Server\Entity\Client; -use League\OAuth2\Server\Authorization; +use League\OAuth2\Server\AuthorizationServer as Authorization; use League\OAuth2\Server\Grant\ClientException; use Mockery as M;