mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Updated tests
This commit is contained in:
@@ -92,7 +92,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$clientStorage = M::mock('League\OAuth2\Server\Storage\ClientInterface');
|
||||
$clientStorage->shouldReceive('setServer');
|
||||
$clientStorage->shouldReceive('get')->andReturn(
|
||||
(new ClientEntity($server))->setId('testapp')
|
||||
(new ClientEntity($server))->hydrate(['id' => 'testapp'])
|
||||
);
|
||||
|
||||
$sessionStorage = M::mock('League\OAuth2\Server\Storage\SessionInterface');
|
||||
@@ -127,7 +127,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$clientStorage = M::mock('League\OAuth2\Server\Storage\ClientInterface');
|
||||
$clientStorage->shouldReceive('setServer');
|
||||
$clientStorage->shouldReceive('get')->andReturn(
|
||||
(new ClientEntity($server))->setId('testapp')
|
||||
(new ClientEntity($server))->hydrate(['id' => 'testapp'])
|
||||
);
|
||||
|
||||
$refreshTokenStorage = M::mock('League\OAuth2\Server\Storage\RefreshTokenInterface');
|
||||
@@ -161,7 +161,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$clientStorage = M::mock('League\OAuth2\Server\Storage\ClientInterface');
|
||||
$clientStorage->shouldReceive('setServer');
|
||||
$clientStorage->shouldReceive('get')->andReturn(
|
||||
(new ClientEntity($server))->setId('testapp')
|
||||
(new ClientEntity($server))->hydrate(['id' => 'testapp'])
|
||||
);
|
||||
|
||||
$sessionStorage = M::mock('League\OAuth2\Server\Storage\SessionInterface');
|
||||
@@ -180,7 +180,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$accessTokenStorage->shouldReceive('delete');
|
||||
$accessTokenStorage->shouldReceive('create');
|
||||
$accessTokenStorage->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->setId('foo')
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
$accessTokenStorage->shouldReceive('associateScope');
|
||||
|
||||
@@ -196,7 +196,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface');
|
||||
$scopeStorage->shouldReceive('setServer');
|
||||
$scopeStorage->shouldReceive('get')->andReturn(
|
||||
(new ScopeEntity($server))->setId('foo')
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
);
|
||||
|
||||
$server->setClientStorage($clientStorage);
|
||||
@@ -228,12 +228,12 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$server = new AuthorizationServer;
|
||||
$grant = new RefreshTokenGrant;
|
||||
|
||||
$oldSession = (new SessionEntity($server))->associateScope((new ScopeEntity($server))->setId('foo'));
|
||||
$oldSession = (new SessionEntity($server))->associateScope((new ScopeEntity($server))->hydrate(['id' => 'foo']));
|
||||
|
||||
$clientStorage = M::mock('League\OAuth2\Server\Storage\ClientInterface');
|
||||
$clientStorage->shouldReceive('setServer');
|
||||
$clientStorage->shouldReceive('get')->andReturn(
|
||||
(new ClientEntity($server))->setId('testapp')
|
||||
(new ClientEntity($server))->hydrate(['id' => 'testapp'])
|
||||
);
|
||||
|
||||
$sessionStorage = M::mock('League\OAuth2\Server\Storage\SessionInterface');
|
||||
@@ -252,7 +252,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$accessTokenStorage->shouldReceive('delete');
|
||||
$accessTokenStorage->shouldReceive('create');
|
||||
$accessTokenStorage->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->setId('foo')
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
$accessTokenStorage->shouldReceive('associateScope');
|
||||
|
||||
@@ -268,7 +268,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface');
|
||||
$scopeStorage->shouldReceive('setServer');
|
||||
$scopeStorage->shouldReceive('get')->andReturn(
|
||||
(new ScopeEntity($server))->setId('foo')
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
);
|
||||
|
||||
$server->setClientStorage($clientStorage);
|
||||
@@ -300,12 +300,12 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$server = new AuthorizationServer;
|
||||
$grant = new RefreshTokenGrant;
|
||||
|
||||
$oldSession = (new SessionEntity($server))->associateScope((new ScopeEntity($server))->setId('foo'));
|
||||
$oldSession = (new SessionEntity($server))->associateScope((new ScopeEntity($server))->hydrate(['id' => 'foo']));
|
||||
|
||||
$clientStorage = M::mock('League\OAuth2\Server\Storage\ClientInterface');
|
||||
$clientStorage->shouldReceive('setServer');
|
||||
$clientStorage->shouldReceive('get')->andReturn(
|
||||
(new ClientEntity($server))->setId('testapp')
|
||||
(new ClientEntity($server))->hydrate(['id' => 'testapp'])
|
||||
);
|
||||
|
||||
$sessionStorage = M::mock('League\OAuth2\Server\Storage\SessionInterface');
|
||||
@@ -324,7 +324,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$accessTokenStorage->shouldReceive('delete');
|
||||
$accessTokenStorage->shouldReceive('create');
|
||||
$accessTokenStorage->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->setId('foo')
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
$accessTokenStorage->shouldReceive('associateScope');
|
||||
|
||||
@@ -340,7 +340,7 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$scopeStorage = M::mock('League\OAuth2\Server\Storage\ScopeInterface');
|
||||
$scopeStorage->shouldReceive('setServer');
|
||||
$scopeStorage->shouldReceive('get')->andReturn(
|
||||
(new ScopeEntity($server))->setId('blah')
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'blah'])
|
||||
);
|
||||
|
||||
$server->setClientStorage($clientStorage);
|
||||
|
||||
Reference in New Issue
Block a user