Add improvements to unit tests

This commit is contained in:
Romain Neutron
2013-12-19 12:08:59 +01:00
parent 49ea64b1c3
commit 6c45e8d40a
39 changed files with 583 additions and 689 deletions

View File

@@ -14,8 +14,7 @@ class API_OAuth2_RefreshTokenTest extends \PhraseanetTestCase
public function setUp()
{
parent::setUp();
$this->application = API_OAuth2_Application::create(self::$DI['app'], self::$DI['user'], 'test app');
$this->account = API_OAuth2_Account::load_with_user(self::$DI['app'], $this->application, self::$DI['user']);
$this->account = API_OAuth2_Account::load_with_user(self::$DI['app'], self::$DI['oauth2-app-user'], self::$DI['user']);
$expires = time() + 100;
$this->token = random::generatePassword(8);
@@ -24,12 +23,6 @@ class API_OAuth2_RefreshTokenTest extends \PhraseanetTestCase
$this->object = API_OAuth2_RefreshToken::create(self::$DI['app'], $this->account, $expires, $this->token, $this->scope);
}
public function tearDown()
{
$this->application->delete();
parent::tearDown();
}
public function testGet_value()
{
$this->assertEquals($this->token, $this->object->get_value());