Updated tests

This commit is contained in:
Alex Bilbie
2014-07-11 18:19:10 +01:00
parent 48dea185d8
commit c6bc1b0cfc
13 changed files with 115 additions and 101 deletions

View File

@@ -16,12 +16,12 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
$time = time();
$entity = new StubAbstractTokenEntity($server);
$entity->setToken('foobar');
$entity->setId('foobar');
$entity->setExpireTime($time);
$entity->setSession((new SessionEntity($server)));
$entity->associateScope((new ScopeEntity($server))->setId('foo'));
$entity->associateScope((new ScopeEntity($server))->hydrate(['id' => 'foo']));
$this->assertEquals('foobar', $entity->getToken());
$this->assertEquals('foobar', $entity->getId());
$this->assertEquals($time, $entity->getExpireTime());
// $this->assertTrue($entity->getSession() instanceof SessionEntity);
// $this->assertTrue($entity->hasScope('foo'));
@@ -92,8 +92,8 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
$method->setAccessible(true);
$scopes = [
(new ScopeEntity($server))->setId('scope1')->setDescription('foo'),
(new ScopeEntity($server))->setId('scope2')->setDescription('bar')
(new ScopeEntity($server))->hydrate(['id' => 'scope1', 'description' => 'foo']),
(new ScopeEntity($server))->hydrate(['id' => 'scope2', 'description' => 'bar'])
];
$result = $method->invokeArgs($entity, [$scopes]);
@@ -110,7 +110,7 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase
$entity = new StubAbstractTokenEntity($server);
$this->assertEquals('', (string) $entity);
$entity->setToken('foobar');
$entity->setId('foobar');
$this->assertEquals('foobar', (string) $entity);
}
}