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\ClientEntity;
|
2014-01-16 22:21:06 +05:30
|
|
|
use \Mockery as M;
|
|
|
|
|
|
|
|
class ClientTest extends \PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
public function testSetGet()
|
|
|
|
{
|
|
|
|
$server = M::mock('League\OAuth2\Server\AbstractServer');
|
2014-05-02 21:51:53 +05:30
|
|
|
$client = new ClientEntity($server);
|
2014-01-16 22:21:06 +05:30
|
|
|
$client->setId('foobar');
|
|
|
|
$client->setSecret('barfoo');
|
|
|
|
$client->setName('Test Client');
|
|
|
|
$client->setRedirectUri('http://foo/bar');
|
|
|
|
|
|
|
|
$this->assertEquals('foobar', $client->getId());
|
|
|
|
$this->assertEquals('barfoo', $client->getSecret());
|
|
|
|
$this->assertEquals('Test Client', $client->getName());
|
|
|
|
$this->assertEquals('http://foo/bar', $client->getRedirectUri());
|
|
|
|
}
|
|
|
|
}
|