mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Cleaned up tests
This commit is contained in:
parent
ed7f5370ca
commit
5c8ed58c67
@ -3,11 +3,10 @@
|
||||
namespace LeagueTests;
|
||||
|
||||
use LeagueTests\Stubs\StubAbstractServer;
|
||||
use \Mockery as M;
|
||||
|
||||
class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
class AbstractServerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSetGet()
|
||||
public function testSetGet()
|
||||
{
|
||||
$server = new StubAbstractServer();
|
||||
$this->assertTrue($server->getRequest() instanceof \Symfony\Component\HttpFoundation\Request);
|
||||
@ -17,10 +16,10 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($server2->getRequest() instanceof \Symfony\Component\HttpFoundation\Request);
|
||||
}
|
||||
|
||||
function testGetStorageException()
|
||||
public function testGetStorageException()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\ServerErrorException');
|
||||
$server = new StubAbstractServer();
|
||||
$server->getStorage('foobar');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ use League\OAuth2\Server\Grant\GrantTypeInterface;
|
||||
use League\OAuth2\Server\Storage\ScopeInterface;
|
||||
use \Mockery as M;
|
||||
|
||||
class AuthorizationTest extends \PHPUnit_Framework_TestCase
|
||||
class AuthorizationServerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetGet()
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
if ( ! @include_once __DIR__ . '/../vendor/autoload.php')
|
||||
{
|
||||
if (! @include_once __DIR__ . '/../vendor/autoload.php') {
|
||||
exit("You must set up the project dependencies, run the following commands:\n> wget http://getcomposer.org/composer.phar\n> php composer.phar install\n");
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use \Mockery as M;
|
||||
|
||||
class AbstractTokenTests extends \PHPUnit_Framework_TestCase
|
||||
class AbstractTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetGet()
|
||||
{
|
||||
|
@ -5,12 +5,11 @@ namespace LeagueTests\Entity;
|
||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\Entity\SessionEntity;
|
||||
use League\OAuth2\Server\Entity\AccessTokenEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use \Mockery as M;
|
||||
|
||||
class AccessTokenTests extends \PHPUnit_Framework_TestCase
|
||||
class AccessTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSave()
|
||||
public function testSave()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
$server->shouldReceive('setAccessTokenStorage');
|
||||
@ -40,7 +39,7 @@ class AccessTokenTests extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($entity->save() instanceof AccessTokenEntity);
|
||||
}
|
||||
|
||||
function testExpire()
|
||||
public function testExpire()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
|
||||
|
@ -10,7 +10,7 @@ use \Mockery as M;
|
||||
|
||||
class AuthCodeTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSetGet()
|
||||
public function testSetGet()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
|
||||
@ -26,7 +26,7 @@ class AuthCodeTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($code->getSession() instanceof \League\OAuth2\Server\Entity\SessionEntity);
|
||||
}
|
||||
|
||||
function testSave()
|
||||
public function testSave()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
$server->shouldReceive('setAuthCodeStorage');
|
||||
@ -57,7 +57,7 @@ class AuthCodeTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($entity->save() instanceof AuthCodeEntity);
|
||||
}
|
||||
|
||||
function testExpire()
|
||||
public function testExpire()
|
||||
{
|
||||
$server = new AuthorizationServer();
|
||||
|
||||
|
@ -21,4 +21,4 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('Test Client', $client->getName());
|
||||
$this->assertEquals('http://foo/bar', $client->getRedirectUri());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,12 +6,11 @@ use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\Entity\SessionEntity;
|
||||
use League\OAuth2\Server\Entity\AccessTokenEntity;
|
||||
use League\OAuth2\Server\Entity\RefreshTokenEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer as Authorization;
|
||||
use \Mockery as M;
|
||||
|
||||
class RefreshTokenTests extends \PHPUnit_Framework_TestCase
|
||||
class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSetAccessToken()
|
||||
public function testSetAccessToken()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
$entity = new RefreshTokenEntity($server);
|
||||
@ -24,7 +23,7 @@ class RefreshTokenTests extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue($accessTokenProperty->getValue($entity) instanceof AccessTokenEntity);
|
||||
}
|
||||
|
||||
function testSave()
|
||||
public function testSave()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
$server->shouldReceive('setAccessTokenStorage');
|
||||
@ -63,7 +62,7 @@ class RefreshTokenTests extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame(null, $entity->save());
|
||||
}
|
||||
|
||||
function testExpire()
|
||||
public function testExpire()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
||||
$server->shouldReceive('setRefreshTokenStorage');
|
||||
|
@ -5,7 +5,7 @@ namespace LeagueTests\Entity;
|
||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use \Mockery as M;
|
||||
|
||||
class ScopeTests extends \PHPUnit_Framework_TestCase
|
||||
class ScopeTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetGet()
|
||||
{
|
||||
@ -17,4 +17,4 @@ class ScopeTests extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foobar', $scope->getId());
|
||||
$this->assertEquals('barfoo', $scope->getDescription());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace LeagueTests\Entity;
|
||||
|
||||
use League\OAuth2\Server\Entity\AccessTokenEntity;
|
||||
use League\OAuth2\Server\Entity\AuthCodeEntity;
|
||||
use League\OAuth2\Server\Entity\ClientEntity;
|
||||
use League\OAuth2\Server\Entity\RefreshTokenEntity;
|
||||
use League\OAuth2\Server\Entity\SessionEntity;
|
||||
@ -11,7 +10,7 @@ use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use \Mockery as M;
|
||||
|
||||
class SessionTests extends \PHPUnit_Framework_TestCase
|
||||
class SessionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetGet()
|
||||
{
|
||||
@ -114,7 +113,7 @@ class SessionTests extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($entity->hasScope('foo'));
|
||||
}
|
||||
|
||||
function testSave()
|
||||
public function testSave()
|
||||
{
|
||||
$server = M::mock('League\OAuth2\Server\AuthorizationServer');
|
||||
$server->shouldReceive('setSessionStorage');
|
||||
@ -144,4 +143,4 @@ class SessionTests extends \PHPUnit_Framework_TestCase
|
||||
$entity = new SessionEntity($server);
|
||||
$this->assertEquals(null, $entity->save());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ use Mockery as M;
|
||||
|
||||
class AbstractGrantTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSetGet()
|
||||
public function testSetGet()
|
||||
{
|
||||
$server = new AuthorizationServer;
|
||||
|
||||
|
@ -121,7 +121,6 @@ class AuthCodeTest extends \PHPUnit_Framework_TestCase
|
||||
$clientStorage->shouldReceive('setServer');
|
||||
$clientStorage->shouldReceive('get')->andReturn(null);
|
||||
|
||||
|
||||
$server->setClientStorage($clientStorage);
|
||||
|
||||
$server->addGrantType($grant);
|
||||
|
@ -6,12 +6,11 @@ use League\OAuth2\Server\Grant\ClientCredentialsGrant;
|
||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\Entity\ClientEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use League\OAuth2\Server\Grant\ClientException;
|
||||
use Mockery as M;
|
||||
|
||||
class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
class ClientCredentialsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testCompleteFlowMissingClientId()
|
||||
public function testCompleteFlowMissingClientId()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -25,7 +24,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
function testCompleteFlowMissingClientSecret()
|
||||
public function testCompleteFlowMissingClientSecret()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -41,7 +40,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidClient()
|
||||
public function testCompleteFlowInvalidClient()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidClientException');
|
||||
|
||||
@ -64,7 +63,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidScope()
|
||||
public function testCompleteFlowInvalidScope()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidScopeException');
|
||||
|
||||
@ -107,7 +106,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowNoScopes()
|
||||
public function testCompleteFlowNoScopes()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'client_credentials',
|
||||
@ -151,7 +150,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlow()
|
||||
public function testCompleteFlow()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'client_credentials',
|
||||
@ -199,4 +198,4 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$server->addGrantType($grant);
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,15 +5,13 @@ namespace LeagueTests\Grant;
|
||||
use League\OAuth2\Server\Grant\PasswordGrant;
|
||||
use League\OAuth2\Server\Grant\RefreshTokenGrant;
|
||||
use League\OAuth2\Server\Entity\ScopeEntity;
|
||||
use League\OAuth2\Server\Entity\AccessTokenEntity;
|
||||
use League\OAuth2\Server\Entity\RefreshTokenEntity;
|
||||
use League\OAuth2\Server\Entity\ClientEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use Mockery as M;
|
||||
|
||||
class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testCompleteFlowMissingClientId()
|
||||
public function testCompleteFlowMissingClientId()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -27,7 +25,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
}
|
||||
|
||||
function testCompleteFlowMissingClientSecret()
|
||||
public function testCompleteFlowMissingClientSecret()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -43,7 +41,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidClient()
|
||||
public function testCompleteFlowInvalidClient()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidClientException');
|
||||
|
||||
@ -66,7 +64,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testNoUsername()
|
||||
public function testNoUsername()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -108,7 +106,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testNoPassword()
|
||||
public function testNoPassword()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -151,7 +149,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testNoCallable()
|
||||
public function testNoCallable()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\ServerErrorException');
|
||||
|
||||
@ -195,7 +193,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidScope()
|
||||
public function testCompleteFlowInvalidScope()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidScopeException');
|
||||
|
||||
@ -243,7 +241,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowNoScopes()
|
||||
public function testCompleteFlowNoScopes()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -292,7 +290,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidCredentials()
|
||||
public function testCompleteFlowInvalidCredentials()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidCredentialsException');
|
||||
|
||||
@ -348,7 +346,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlow()
|
||||
public function testCompleteFlow()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'password',
|
||||
@ -407,7 +405,7 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($response['expires']));
|
||||
}
|
||||
|
||||
function testCompleteFlowRefreshToken()
|
||||
public function testCompleteFlowRefreshToken()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'password',
|
||||
@ -474,4 +472,4 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($response['expires_in']));
|
||||
$this->assertTrue(isset($response['expires']));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ use Mockery as M;
|
||||
|
||||
class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSetRefreshTokenTTL()
|
||||
public function testSetRefreshTokenTTL()
|
||||
{
|
||||
$grant = new RefreshTokenGrant;
|
||||
$grant->setRefreshTokenTTL(86400);
|
||||
@ -24,7 +24,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(86400, $property->getValue($grant));
|
||||
}
|
||||
|
||||
function testCompleteFlowMissingClientId()
|
||||
public function testCompleteFlowMissingClientId()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -37,7 +37,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowMissingClientSecret()
|
||||
public function testCompleteFlowMissingClientSecret()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -53,7 +53,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidClient()
|
||||
public function testCompleteFlowInvalidClient()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidClientException');
|
||||
|
||||
@ -76,7 +76,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowMissingRefreshToken()
|
||||
public function testCompleteFlowMissingRefreshToken()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRequestException');
|
||||
|
||||
@ -110,7 +110,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowInvalidRefreshToken()
|
||||
public function testCompleteFlowInvalidRefreshToken()
|
||||
{
|
||||
$this->setExpectedException('League\OAuth2\Server\Exception\InvalidRefreshException');
|
||||
|
||||
@ -146,7 +146,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
|
||||
function testCompleteFlowExistingScopes()
|
||||
public function testCompleteFlowExistingScopes()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'refresh_token',
|
||||
@ -215,7 +215,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($response['expires']));
|
||||
}
|
||||
|
||||
function testCompleteFlowRequestScopes()
|
||||
public function testCompleteFlowRequestScopes()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'refresh_token',
|
||||
@ -287,7 +287,7 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($response['expires']));
|
||||
}
|
||||
|
||||
function testCompleteFlowRequestScopesInvalid()
|
||||
public function testCompleteFlowRequestScopesInvalid()
|
||||
{
|
||||
$_POST = [
|
||||
'grant_type' => 'refresh_token',
|
||||
@ -355,4 +355,4 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$server->issueAccessToken();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace LeagueTests;
|
||||
|
||||
use League\OAuth2\Server\ResourceServer;
|
||||
use League\OAuth2\Server\Grant\GrantTypeInterface;
|
||||
use League\OAuth2\Server\Entity\AccessTokenEntity;
|
||||
use League\OAuth2\Server\Entity\SessionEntity;
|
||||
use League\OAuth2\Server\Entity\ClientEntity;
|
||||
@ -33,7 +32,7 @@ class ResourceServerTest extends \PHPUnit_Framework_TestCase
|
||||
return $server;
|
||||
}
|
||||
|
||||
function testGetSet()
|
||||
public function testGetSet()
|
||||
{
|
||||
$sessionStorage = M::mock('League\OAuth2\Server\Storage\SessionInterface');
|
||||
$sessionStorage->shouldReceive('setServer');
|
||||
|
@ -4,11 +4,10 @@ namespace LeagueTests\Storage;
|
||||
|
||||
use League\OAuth2\Server\Storage\Adapter;
|
||||
use LeagueTests\Stubs\StubAbstractServer;
|
||||
use \Mockery as M;
|
||||
|
||||
class AdapterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testSetGet()
|
||||
public function testSetGet()
|
||||
{
|
||||
$adapter = new Adapter;
|
||||
|
||||
@ -21,4 +20,4 @@ class AdapterTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertTrue($getMethod->invoke($adapter) instanceof StubAbstractServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,4 +20,4 @@ class StubAbstractGrant extends \League\OAuth2\Server\Grant\AbstractGrant
|
||||
{
|
||||
return $this->server;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ namespace LeagueTests\Stubs;
|
||||
class StubAbstractServer extends \League\OAuth2\Server\AbstractServer
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -15,4 +15,4 @@ class StubAbstractTokenEntity extends AbstractTokenEntity
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace LeagueTests\Util;
|
||||
namespace LeagueTests\util;
|
||||
|
||||
use League\OAuth2\Server\Util\RedirectUri;
|
||||
use \Mockery as M;
|
||||
|
||||
class RedirectUriTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testMake()
|
||||
{
|
||||
$v1 = RedirectUri::make('https://foobar/', array('foo'=>'bar'));
|
||||
$v2 = RedirectUri::make('https://foobar/', array('foo'=>'bar'), '#');
|
||||
$v3 = RedirectUri::make('https://foobar/', array('foo'=>'bar', 'bar' => 'foo'));
|
||||
public function testMake()
|
||||
{
|
||||
$v1 = RedirectUri::make('https://foobar/', array('foo'=>'bar'));
|
||||
$v2 = RedirectUri::make('https://foobar/', array('foo'=>'bar'), '#');
|
||||
$v3 = RedirectUri::make('https://foobar/', array('foo'=>'bar', 'bar' => 'foo'));
|
||||
|
||||
$this->assertEquals('https://foobar/?foo=bar', $v1);
|
||||
$this->assertEquals('https://foobar/#foo=bar', $v2);
|
||||
$this->assertEquals('https://foobar/?foo=bar&bar=foo', $v3);
|
||||
}
|
||||
}
|
||||
$this->assertEquals('https://foobar/?foo=bar', $v1);
|
||||
$this->assertEquals('https://foobar/#foo=bar', $v2);
|
||||
$this->assertEquals('https://foobar/?foo=bar&bar=foo', $v3);
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace LeagueTests\Util;
|
||||
namespace LeagueTests\util;
|
||||
|
||||
use \League\OAuth2\Server\Util\SecureKey;
|
||||
use \Mockery as M;
|
||||
|
||||
class SecureKeyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
function testGenerate()
|
||||
public function testGenerate()
|
||||
{
|
||||
$v1 = SecureKey::generate();
|
||||
$v2 = SecureKey::generate();
|
||||
@ -34,4 +33,4 @@ class SecureKeyTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($algorithm, SecureKey::getAlgorithm());
|
||||
$this->assertEquals($result, SecureKey::generate(11));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user