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,21 +14,12 @@ class API_OAuth2_AuthCodeTest 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->code = random::generatePassword(8);
$this->object = API_OAuth2_AuthCode::create(self::$DI['app'], $this->account, $this->code, $expires);
}
public function tearDown()
{
$this->application->delete();
parent::tearDown();
}
public function testGet_code()
{
$this->assertEquals($this->code, $this->object->get_code());