mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 23:43:12 +00:00
Add improvements to unit tests
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user