oauth2-server/tests/unit/Entity/ScopeEntityTest.php

24 lines
596 B
PHP
Raw Normal View History

2014-01-16 16:51:06 +00:00
<?php
2014-05-02 15:12:15 +01:00
namespace LeagueTests\Entity;
2014-01-16 16:51:06 +00:00
2014-05-02 15:12:15 +01:00
use League\OAuth2\Server\Entity\ScopeEntity;
2014-11-08 18:26:12 +00:00
use Mockery as M;
2014-01-16 16:51:06 +00:00
2014-11-08 18:26:12 +00:00
class ScopeEntityTest extends \PHPUnit_Framework_TestCase
2014-01-16 16:51:06 +00:00
{
public function testSetGet()
{
$server = M::mock('League\OAuth2\Server\AbstractServer');
2014-07-11 18:19:10 +01:00
$scope = (new ScopeEntity($server))->hydrate([
'id' => 'foobar',
2014-11-08 18:26:12 +00:00
'description' => 'barfoo',
2014-07-11 18:19:10 +01:00
]);
2014-01-16 16:51:06 +00:00
$this->assertEquals('foobar', $scope->getId());
$this->assertEquals('barfoo', $scope->getDescription());
2014-05-08 11:55:04 +01:00
$this->assertTrue(is_array($scope->jsonSerialize()));
2014-01-16 16:51:06 +00:00
}
2014-05-03 10:55:25 +01:00
}