Cleaned up tests

This commit is contained in:
Alex Bilbie
2014-05-03 10:55:25 +01:00
parent ed7f5370ca
commit 5c8ed58c67
22 changed files with 75 additions and 88 deletions

View File

@@ -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()
{

View File

@@ -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');

View File

@@ -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();

View File

@@ -21,4 +21,4 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('Test Client', $client->getName());
$this->assertEquals('http://foo/bar', $client->getRedirectUri());
}
}
}

View File

@@ -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');

View File

@@ -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());
}
}
}

View File

@@ -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());
}
}
}