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:
@@ -135,23 +135,23 @@ class ResourceServerTest extends \PHPUnit_Framework_TestCase
|
||||
$scopeStorage
|
||||
);
|
||||
|
||||
$server->setTokenKey('at');
|
||||
$server->setIdKey('at');
|
||||
|
||||
$accessTokenStorage->shouldReceive('get')->andReturn(
|
||||
(new AccessTokenEntity($server))->setToken('abcdef')
|
||||
(new AccessTokenEntity($server))->setId('abcdef')
|
||||
);
|
||||
|
||||
$accessTokenStorage->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->setId('foo'),
|
||||
(new ScopeEntity($server))->setId('bar')
|
||||
]);
|
||||
// $accessTokenStorage->shouldReceive('getScopes')->andReturn([
|
||||
// (new ScopeEntity($server))->hydrate(['id' => 'foo']),
|
||||
// (new ScopeEntity($server))->hydrate(['id' => 'bar'])
|
||||
// ]);
|
||||
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')->setOwner('user', 123)
|
||||
);
|
||||
|
||||
$clientStorage->shouldReceive('getBySession')->andReturn(
|
||||
(new ClientEntity($server))->setId('testapp')
|
||||
(new ClientEntity($server))->hydrate(['id' => 'testapp'])
|
||||
);
|
||||
|
||||
$request = new \Symfony\Component\HttpFoundation\Request();
|
||||
@@ -161,7 +161,7 @@ class ResourceServerTest extends \PHPUnit_Framework_TestCase
|
||||
$server->setRequest($request);
|
||||
|
||||
$this->assertTrue($server->isValidRequest());
|
||||
$this->assertEquals('at', $server->getTokenKey());
|
||||
$this->assertEquals('at', $server->getIdKey());
|
||||
$this->assertEquals(123, $server->getOwnerId());
|
||||
$this->assertEquals('user', $server->getOwnerType());
|
||||
$this->assertEquals('abcdef', $server->getAccessToken());
|
||||
|
||||
Reference in New Issue
Block a user