mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-03 10:41:51 +05:30
Updated sessions
This commit is contained in:
parent
86fb02d218
commit
f5251a6080
@ -376,7 +376,8 @@ class Auth_Code_Grant_Test extends PHPUnit_Framework_TestCase
|
|||||||
$this->session->shouldReceive('createSession')->andReturn(1);
|
$this->session->shouldReceive('createSession')->andReturn(1);
|
||||||
$this->session->shouldReceive('associateScope')->andReturn(null);
|
$this->session->shouldReceive('associateScope')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateRedirectUri')->andReturn(null);
|
$this->session->shouldReceive('associateRedirectUri')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateAuthCode')->andReturn(null);
|
$this->session->shouldReceive('associateAuthCode')->andReturn(1);
|
||||||
|
$this->session->shouldReceive('associateAuthCodeScope')->andReturn(null);
|
||||||
|
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$g = new League\OAuth2\Server\Grant\AuthCode($a);
|
$g = new League\OAuth2\Server\Grant\AuthCode($a);
|
||||||
|
@ -358,13 +358,14 @@ class Authorization_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
));
|
));
|
||||||
|
|
||||||
$this->session->shouldReceive('validateAuthCode')->andReturn(array(
|
$this->session->shouldReceive('validateAuthCode')->andReturn(array(
|
||||||
'id' => 1,
|
'session_id' => 1,
|
||||||
'scope_ids' => '1'
|
'authcode_id' => 1
|
||||||
));
|
));
|
||||||
$this->session->shouldReceive('updateSession')->andReturn(null);
|
$this->session->shouldReceive('updateSession')->andReturn(null);
|
||||||
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
||||||
$this->session->shouldReceive('associateScope')->andReturn(null);
|
$this->session->shouldReceive('associateScope')->andReturn(null);
|
||||||
|
$this->session->shouldReceive('getAuthCodeScopes')->andReturn(array('scope_id' => 1));
|
||||||
|
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
||||||
@ -399,6 +400,8 @@ class Authorization_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$this->session->shouldReceive('updateSession')->andReturn(null);
|
$this->session->shouldReceive('updateSession')->andReturn(null);
|
||||||
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
||||||
|
$this->session->shouldReceive('getAuthCodeScopes')->andReturn(array('scope_id' => 1));
|
||||||
|
$this->session->shouldReceive('associateScope')->andReturn(null);
|
||||||
|
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
||||||
@ -436,6 +439,8 @@ class Authorization_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$this->session->shouldReceive('updateSession')->andReturn(null);
|
$this->session->shouldReceive('updateSession')->andReturn(null);
|
||||||
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
||||||
|
$this->session->shouldReceive('getAuthCodeScopes')->andReturn(array('scope_id' => 1));
|
||||||
|
$this->session->shouldReceive('associateScope')->andReturn(null);
|
||||||
|
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$grant = new League\OAuth2\Server\Grant\AuthCode($a);
|
$grant = new League\OAuth2\Server\Grant\AuthCode($a);
|
||||||
@ -477,6 +482,8 @@ class Authorization_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$this->session->shouldReceive('updateSession')->andReturn(null);
|
$this->session->shouldReceive('updateSession')->andReturn(null);
|
||||||
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
||||||
|
$this->session->shouldReceive('getAuthCodeScopes')->andReturn(array('scope_id' => 1));
|
||||||
|
$this->session->shouldReceive('associateScope')->andReturn(null);
|
||||||
|
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
||||||
|
@ -42,6 +42,8 @@ class Refresh_Token_test extends PHPUnit_Framework_TestCase
|
|||||||
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
$this->session->shouldReceive('removeAuthCode')->andReturn(null);
|
||||||
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
$this->session->shouldReceive('associateAccessToken')->andReturn(1);
|
||||||
$this->session->shouldReceive('associateRefreshToken')->andReturn(1);
|
$this->session->shouldReceive('associateRefreshToken')->andReturn(1);
|
||||||
|
$this->session->shouldReceive('associateScope')->andReturn(null);
|
||||||
|
$this->session->shouldReceive('getAuthCodeScopes')->andReturn(array('scope_id' => 1));
|
||||||
|
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
$a->addGrantType(new League\OAuth2\Server\Grant\AuthCode($a));
|
||||||
|
Loading…
Reference in New Issue
Block a user