mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Fixed ResourceServerTest.php
This commit is contained in:
parent
38f6be2aa0
commit
9349425ecd
@ -142,11 +142,16 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
public function test_isValid_valid()
|
public function test_isValid_valid()
|
||||||
{
|
{
|
||||||
$this->session->shouldReceive('validateAccessToken')->andReturn(array(
|
$this->session->shouldReceive('validateAccessToken')->andReturn(array(
|
||||||
'id' => 1,
|
'session_id' => 1,
|
||||||
'owner_type' => 'user',
|
'owner_type' => 'user',
|
||||||
'owner_id' => 123
|
'owner_id' => 123,
|
||||||
|
'client_id' => 'testapp'
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->session->shouldReceive('getScopes')->andReturn(array(
|
||||||
|
array('key' => 'foo'),
|
||||||
|
array('key' => 'bar')
|
||||||
));
|
));
|
||||||
$this->session->shouldReceive('getScopes')->andReturn(array('foo', 'bar'));
|
|
||||||
|
|
||||||
$request = new OAuth2\Util\Request();
|
$request = new OAuth2\Util\Request();
|
||||||
$requestReflector = new ReflectionClass($request);
|
$requestReflector = new ReflectionClass($request);
|
||||||
@ -155,6 +160,7 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$param->setValue($request, array(
|
$param->setValue($request, array(
|
||||||
'Authorization' => 'Bearer abcdef'
|
'Authorization' => 'Bearer abcdef'
|
||||||
));
|
));
|
||||||
|
|
||||||
$s = $this->returnDefault();
|
$s = $this->returnDefault();
|
||||||
$s->setRequest($request);
|
$s->setRequest($request);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user