mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
100% test coverage
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user