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

26 lines
751 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\ClientEntity;
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 ClientEntityTest 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
$client = (new ClientEntity($server))->hydrate([
'id' => 'foobar',
'secret' => 'barfoo',
'name' => 'Test Client',
2014-11-08 23:56:12 +05:30
'redirectUri' => 'http://foo/bar',
2014-07-11 22:49:10 +05:30
]);
2014-01-16 22:21:06 +05:30
$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 15:25:25 +05:30
}