100% test coverage

This commit is contained in:
Alex Bilbie
2014-06-20 14:29:47 +01:00
parent f24d1be3e9
commit 9af1d2a201
4 changed files with 65 additions and 5 deletions

View File

@@ -74,7 +74,7 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
$accessTokenStorage->shouldReceive('getScopes')->andReturn(
[]
);
$accessTokenStorage->shouldReceive('setServer');
$accessTokenStorage''>shouldReceive('setServer');
$server->setAccessTokenStorage($accessTokenStorage);
@@ -103,4 +103,14 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($result['scope1'] instanceof ScopeEntity);
$this->assertTrue($result['scope2'] instanceof ScopeEntity);
}
public function test__toString()
{
$server = M::mock('League\OAuth2\Server\AbstractServer');
$entity = new StubAbstractTokenEntity($server);
$this->assertEquals('', (string) $entity);
$entity->setToken('foobar');
$this->assertEquals('foobar', (string) $entity);
}
}