mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
template renderer holds template related information
This commit is contained in:
@@ -28,9 +28,7 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->getMock(AuthCodeRepositoryInterface::class),
|
||||
$this->getMock(RefreshTokenRepositoryInterface::class),
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
new \DateInterval('PT10M'),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
new \DateInterval('PT10M')
|
||||
);
|
||||
|
||||
$this->assertEquals('authorization_code', $grant->getIdentifier());
|
||||
@@ -77,9 +75,7 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->getMock(AuthCodeRepositoryInterface::class),
|
||||
$this->getMock(RefreshTokenRepositoryInterface::class),
|
||||
$userRepositoryMock,
|
||||
new \DateInterval('PT10M'),
|
||||
'',
|
||||
''
|
||||
new \DateInterval('PT10M')
|
||||
);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
@@ -134,9 +130,7 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->getMock(AuthCodeRepositoryInterface::class),
|
||||
$this->getMock(RefreshTokenRepositoryInterface::class),
|
||||
$userRepositoryMock,
|
||||
new \DateInterval('PT10M'),
|
||||
'',
|
||||
''
|
||||
new \DateInterval('PT10M')
|
||||
);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
@@ -196,9 +190,7 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->getMock(AuthCodeRepositoryInterface::class),
|
||||
$this->getMock(RefreshTokenRepositoryInterface::class),
|
||||
$userRepositoryMock,
|
||||
new \DateInterval('PT10M'),
|
||||
'',
|
||||
''
|
||||
new \DateInterval('PT10M')
|
||||
);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
@@ -365,9 +357,7 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->getMock(AuthCodeRepositoryInterface::class),
|
||||
$this->getMock(RefreshTokenRepositoryInterface::class),
|
||||
$userRepositoryMock,
|
||||
new \DateInterval('PT10M'),
|
||||
'',
|
||||
''
|
||||
new \DateInterval('PT10M')
|
||||
);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
@@ -417,9 +407,7 @@ class AuthCodeGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->getMock(AuthCodeRepositoryInterface::class),
|
||||
$this->getMock(RefreshTokenRepositoryInterface::class),
|
||||
$userRepositoryMock,
|
||||
new \DateInterval('PT10M'),
|
||||
'',
|
||||
''
|
||||
new \DateInterval('PT10M')
|
||||
);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
|
@@ -18,22 +18,14 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testGetIdentifier()
|
||||
{
|
||||
$grant = new ImplicitGrant(
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
);
|
||||
$grant = new ImplicitGrant($this->getMock(UserRepositoryInterface::class));
|
||||
|
||||
$this->assertEquals('implicit', $grant->getIdentifier());
|
||||
}
|
||||
|
||||
public function testCanRespondToRequest()
|
||||
{
|
||||
$grant = new ImplicitGrant(
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
);
|
||||
$grant = new ImplicitGrant($this->getMock(UserRepositoryInterface::class));
|
||||
|
||||
$request = new ServerRequest(
|
||||
[],
|
||||
@@ -65,7 +57,7 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$accessTokenRepositoryMock = $this->getMockBuilder(AccessTokenRepositoryInterface::class)->getMock();
|
||||
$accessTokenRepositoryMock->method('persistNewAccessToken')->willReturnSelf();
|
||||
|
||||
$grant = new ImplicitGrant($userRepositoryMock, 'foo', 'foo');
|
||||
$grant = new ImplicitGrant($userRepositoryMock);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setAccessTokenRepository($accessTokenRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
@@ -106,11 +98,7 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testRespondToAuthorizationRequestMissingClientId()
|
||||
{
|
||||
$grant = new ImplicitGrant(
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
);
|
||||
$grant = new ImplicitGrant($this->getMock(UserRepositoryInterface::class));
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
$grant->setPathToPrivateKey('file://' . __DIR__ . '/../Utils/private.key');
|
||||
|
||||
@@ -151,11 +139,7 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$clientRepositoryMock = $this->getMockBuilder(ClientRepositoryInterface::class)->getMock();
|
||||
$clientRepositoryMock->method('getClientEntity')->willReturn($client);
|
||||
|
||||
$grant = new ImplicitGrant(
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
);
|
||||
$grant = new ImplicitGrant($this->getMock(UserRepositoryInterface::class));
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
$grant->setPathToPrivateKey('file://' . __DIR__ . '/../Utils/private.key');
|
||||
@@ -205,11 +189,7 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$userEntity = new UserEntity();
|
||||
$userRepositoryMock->method('getUserEntityByUserCredentials')->willReturn($userEntity);
|
||||
|
||||
$grant = new ImplicitGrant(
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
);
|
||||
$grant = new ImplicitGrant($this->getMock(UserRepositoryInterface::class));
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
$grant->setPathToPrivateKey('file://' . __DIR__ . '/../Utils/private.key');
|
||||
@@ -265,11 +245,7 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$userEntity = new UserEntity();
|
||||
$userRepositoryMock->method('getUserEntityByUserCredentials')->willReturn($userEntity);
|
||||
|
||||
$grant = new ImplicitGrant(
|
||||
$this->getMock(UserRepositoryInterface::class),
|
||||
'foo/bar.php',
|
||||
'foo/bar.php'
|
||||
);
|
||||
$grant = new ImplicitGrant($this->getMock(UserRepositoryInterface::class));
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setPathToPublicKey('file://' . __DIR__ . '/../Utils/public.key');
|
||||
$grant->setPathToPrivateKey('file://' . __DIR__ . '/../Utils/private.key');
|
||||
|
Reference in New Issue
Block a user