Updated tests

This commit is contained in:
Alex Bilbie
2014-07-11 18:19:10 +01:00
parent 48dea185d8
commit c6bc1b0cfc
13 changed files with 115 additions and 101 deletions

View File

@@ -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);