mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-26 16:52:04 +05:30
Fixed broken tests
This commit is contained in:
parent
f01cf7ef2f
commit
db7c42cc91
@ -526,6 +526,9 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$sessionStorage->shouldReceive('getByAuthCode')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
@ -594,6 +597,9 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$sessionStorage->shouldReceive('getByAuthCode')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
|
@ -4,6 +4,7 @@ namespace LeagueTests\Grant;
|
||||
|
||||
use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\Entity\SessionEntity;
|
||||
use League\OAuth2\Server\Entity\ClientEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use Mockery as M;
|
||||
@ -127,6 +128,9 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$sessionStorage->shouldReceive('setServer');
|
||||
$sessionStorage->shouldReceive('create')->andreturn(123);
|
||||
$sessionStorage->shouldReceive('getScopes')->shouldReceive('getScopes')->andReturn([]);
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('associateScope');
|
||||
|
||||
$accessTokenStorage = M::mock('League\OAuth2\Server\Storage\AccessTokenInterface');
|
||||
@ -174,6 +178,9 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$sessionStorage->shouldReceive('getScopes')->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('associateScope');
|
||||
|
||||
$accessTokenStorage = M::mock('League\OAuth2\Server\Storage\AccessTokenInterface');
|
||||
@ -221,6 +228,9 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$sessionStorage = M::mock('League\OAuth2\Server\Storage\SessionInterface');
|
||||
$sessionStorage->shouldReceive('setServer');
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
|
||||
$accessTokenStorage = M::mock('League\OAuth2\Server\Storage\AccessTokenInterface');
|
||||
$accessTokenStorage->shouldReceive('setServer');
|
||||
|
@ -6,6 +6,7 @@ use League\OAuth2\Server\Grant\PasswordGrant;
|
||||
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\Entity\ClientEntity;
|
||||
use League\OAuth2\Server\Entity\SessionEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use Mockery as M;
|
||||
|
||||
@ -372,6 +373,9 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$sessionStorage->shouldReceive('getScopes')->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('associateScope');
|
||||
|
||||
$accessTokenStorage = M::mock('League\OAuth2\Server\Storage\AccessTokenInterface');
|
||||
@ -430,6 +434,9 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$sessionStorage->shouldReceive('getScopes')->shouldReceive('getScopes')->andReturn([
|
||||
(new ScopeEntity($server))->hydrate(['id' => 'foo'])
|
||||
]);
|
||||
$sessionStorage->shouldReceive('getByAccessToken')->andReturn(
|
||||
(new SessionEntity($server))->setId('foobar')
|
||||
);
|
||||
$sessionStorage->shouldReceive('associateScope');
|
||||
|
||||
$accessTokenStorage = M::mock('League\OAuth2\Server\Storage\AccessTokenInterface');
|
||||
|
Loading…
Reference in New Issue
Block a user