mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 18:19:47 +05:30
Update request class namespace
This commit is contained in:
parent
920fd9344f
commit
e903cbee68
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace OAuth2;
|
namespace OAuth2;
|
||||||
|
|
||||||
|
use OAuth2\Util\Request;
|
||||||
use OAuth2\Util\SecureKey;
|
use OAuth2\Util\SecureKey;
|
||||||
use OAuth2\Storage\SessionInterface;
|
use OAuth2\Storage\SessionInterface;
|
||||||
use OAuth2\Storage\ClientInterface;
|
use OAuth2\Storage\ClientInterface;
|
||||||
@ -122,7 +123,7 @@ class AuthServer
|
|||||||
*
|
*
|
||||||
* @param RequestInterface The Request Object
|
* @param RequestInterface The Request Object
|
||||||
*/
|
*/
|
||||||
public function setRequest(RequestInterface $request)
|
public function setRequest(Util\RequestInterface $request)
|
||||||
{
|
{
|
||||||
self::$request = $request;
|
self::$request = $request;
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
public function test_setRequest()
|
public function test_setRequest()
|
||||||
{
|
{
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$request = new \OAuth2\Request();
|
$request = new OAuth2\Util\Request();
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$reflector = new ReflectionClass($a);
|
$reflector = new ReflectionClass($a);
|
||||||
@ -109,17 +109,17 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$requestProperty->setAccessible(true);
|
$requestProperty->setAccessible(true);
|
||||||
$v = $requestProperty->getValue();
|
$v = $requestProperty->getValue();
|
||||||
|
|
||||||
$this->assertTrue($v instanceof OAuth2\RequestInterface);
|
$this->assertTrue($v instanceof OAuth2\Util\RequestInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_getRequest()
|
public function test_getRequest()
|
||||||
{
|
{
|
||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$request = new OAuth2\Request();
|
$request = new OAuth2\Util\Request();
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
$v = $a::getRequest();
|
$v = $a::getRequest();
|
||||||
|
|
||||||
$this->assertTrue($v instanceof OAuth2\RequestInterface);
|
$this->assertTrue($v instanceof OAuth2\Util\RequestInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_getStorage()
|
public function test_getStorage()
|
||||||
@ -327,7 +327,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$_GET['response_type'] = 'code';
|
$_GET['response_type'] = 'code';
|
||||||
$_GET['scope'] = 'foo';
|
$_GET['scope'] = 'foo';
|
||||||
|
|
||||||
$request = new OAuth2\Request($_GET);
|
$request = new OAuth2\Util\Request($_GET);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->checkAuthoriseParams();
|
$v = $a->checkAuthoriseParams();
|
||||||
@ -581,7 +581,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$_POST['redirect_uri'] = 'http://foo/redirect';
|
$_POST['redirect_uri'] = 'http://foo/redirect';
|
||||||
$_POST['code'] = 'foobar';
|
$_POST['code'] = 'foobar';
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken();
|
$v = $a->issueAccessToken();
|
||||||
@ -617,7 +617,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$_POST['redirect_uri'] = 'http://foo/redirect';
|
$_POST['redirect_uri'] = 'http://foo/redirect';
|
||||||
$_POST['code'] = 'foobar';
|
$_POST['code'] = 'foobar';
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken();
|
$v = $a->issueAccessToken();
|
||||||
@ -641,7 +641,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -658,7 +658,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -678,7 +678,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -699,7 +699,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -722,7 +722,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
$a->addGrantType(new OAuth2\Grant\RefreshToken());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -756,7 +756,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$_POST['client_secret'] = 5678;
|
$_POST['client_secret'] = 5678;
|
||||||
$_POST['refresh_token'] = 'abcdef';
|
$_POST['refresh_token'] = 'abcdef';
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken();
|
$v = $a->issueAccessToken();
|
||||||
@ -815,7 +815,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\ClientCredentials());
|
$a->addGrantType(new OAuth2\Grant\ClientCredentials());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -832,7 +832,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\ClientCredentials());
|
$a->addGrantType(new OAuth2\Grant\ClientCredentials());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -852,7 +852,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$a = $this->returnDefault();
|
$a = $this->returnDefault();
|
||||||
$a->addGrantType(new OAuth2\Grant\ClientCredentials());
|
$a->addGrantType(new OAuth2\Grant\ClientCredentials());
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken(array(
|
$v = $a->issueAccessToken(array(
|
||||||
@ -920,7 +920,7 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
|||||||
$_POST['client_id'] = 1234;
|
$_POST['client_id'] = 1234;
|
||||||
$_POST['client_secret'] = 5678;
|
$_POST['client_secret'] = 5678;
|
||||||
|
|
||||||
$request = new OAuth2\Request(array(), $_POST);
|
$request = new OAuth2\Util\Request(array(), $_POST);
|
||||||
$a->setRequest($request);
|
$a->setRequest($request);
|
||||||
|
|
||||||
$v = $a->issueAccessToken();
|
$v = $a->issueAccessToken();
|
||||||
|
Loading…
Reference in New Issue
Block a user