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

24 lines
596 B
PHP
Raw Normal View History

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