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\ClientEntity;
|
2014-01-16 16:51:06 +00:00
|
|
|
use \Mockery as M;
|
|
|
|
|
|
|
|
class ClientTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
public function testSetGet()
|
|
|
|
{
|
|
|
|
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
2014-07-11 18:19:10 +01:00
|
|
|
$client = (new ClientEntity($server))->hydrate([
|
|
|
|
'id' => 'foobar',
|
|
|
|
'secret' => 'barfoo',
|
|
|
|
'name' => 'Test Client',
|
|
|
|
'redirectUri' => 'http://foo/bar'
|
|
|
|
]);
|
2014-01-16 16:51:06 +00:00
|
|
|
|
|
|
|
$this->assertEquals('foobar', $client->getId());
|
|
|
|
$this->assertEquals('barfoo', $client->getSecret());
|
|
|
|
$this->assertEquals('Test Client', $client->getName());
|
|
|
|
$this->assertEquals('http://foo/bar', $client->getRedirectUri());
|
|
|
|
}
|
2014-05-03 10:55:25 +01:00
|
|
|
}
|