mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Fix CS in unit tests + remove unused unit tests
This commit is contained in:
@@ -4,81 +4,80 @@ require_once __DIR__ . '/../../PhraseanetPHPUnitAbstract.class.inc';
|
||||
|
||||
class API_OAuth2_AccountTest extends PhraseanetPHPUnitAbstract
|
||||
{
|
||||
/**
|
||||
* @var API_OAuth2_Application
|
||||
*/
|
||||
protected $application;
|
||||
|
||||
/**
|
||||
* @var API_OAuth2_Application
|
||||
*/
|
||||
protected $application;
|
||||
/**
|
||||
* @var API_OAuth2_Account
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* @var API_OAuth2_Account
|
||||
*/
|
||||
protected $object;
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$this->application = API_OAuth2_Application::create($appbox, self::$user, 'test app');
|
||||
$this->object = API_OAuth2_Account::load_with_user($appbox, $this->application, self::$user);
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$this->application = API_OAuth2_Application::create($appbox, self::$user, 'test app');
|
||||
$this->object = API_OAuth2_Account::load_with_user($appbox, $this->application, self::$user);
|
||||
}
|
||||
public function tearDown()
|
||||
{
|
||||
$this->application->delete();
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
$this->application->delete();
|
||||
}
|
||||
public function testGet_id()
|
||||
{
|
||||
$this->assertTrue(is_int($this->object->get_id()));
|
||||
}
|
||||
|
||||
public function testGet_id()
|
||||
{
|
||||
$this->assertTrue(is_int($this->object->get_id()));
|
||||
}
|
||||
public function testGet_user()
|
||||
{
|
||||
$this->assertInstanceOf('User_Adapter', $this->object->get_user());
|
||||
$this->assertEquals(self::$user, $this->object->get_user());
|
||||
}
|
||||
|
||||
public function testGet_user()
|
||||
{
|
||||
$this->assertInstanceOf('User_Adapter', $this->object->get_user());
|
||||
$this->assertEquals(self::$user, $this->object->get_user());
|
||||
}
|
||||
public function testGet_api_version()
|
||||
{
|
||||
$this->assertEquals('1.0', $this->object->get_api_version());
|
||||
}
|
||||
|
||||
public function testGet_api_version()
|
||||
{
|
||||
$this->assertEquals('1.0', $this->object->get_api_version());
|
||||
}
|
||||
public function testIs_revoked()
|
||||
{
|
||||
$this->assertTrue(is_bool($this->object->is_revoked()));
|
||||
$this->assertFalse($this->object->is_revoked());
|
||||
}
|
||||
|
||||
public function testIs_revoked()
|
||||
{
|
||||
$this->assertTrue(is_bool($this->object->is_revoked()));
|
||||
$this->assertFalse($this->object->is_revoked());
|
||||
}
|
||||
public function testSet_revoked()
|
||||
{
|
||||
$this->object->set_revoked(true);
|
||||
$this->assertTrue($this->object->is_revoked());
|
||||
$this->object->set_revoked(false);
|
||||
$this->assertFalse($this->object->is_revoked());
|
||||
}
|
||||
|
||||
public function testSet_revoked()
|
||||
{
|
||||
$this->object->set_revoked(true);
|
||||
$this->assertTrue($this->object->is_revoked());
|
||||
$this->object->set_revoked(false);
|
||||
$this->assertFalse($this->object->is_revoked());
|
||||
}
|
||||
public function testGet_created_on()
|
||||
{
|
||||
$this->assertInstanceOf('DateTime', $this->object->get_created_on());
|
||||
}
|
||||
|
||||
public function testGet_created_on()
|
||||
{
|
||||
$this->assertInstanceOf('DateTime', $this->object->get_created_on());
|
||||
}
|
||||
public function testGet_token()
|
||||
{
|
||||
$this->assertInstanceOf('API_OAuth2_Token', $this->object->get_token());
|
||||
}
|
||||
|
||||
public function testGet_token()
|
||||
{
|
||||
$this->assertInstanceOf('API_OAuth2_Token', $this->object->get_token());
|
||||
}
|
||||
|
||||
public function testGet_application()
|
||||
{
|
||||
$this->assertInstanceOf('API_OAuth2_Application', $this->object->get_application());
|
||||
$this->assertEquals($this->application, $this->object->get_application());
|
||||
}
|
||||
|
||||
public function testLoad_with_user()
|
||||
{
|
||||
$loaded = API_OAuth2_Account::load_with_user(appbox::get_instance(\bootstrap::getCore()), $this->application, self::$user);
|
||||
$this->assertInstanceOf('API_OAuth2_Account', $loaded);
|
||||
$this->assertEquals($this->object, $loaded);
|
||||
}
|
||||
public function testGet_application()
|
||||
{
|
||||
$this->assertInstanceOf('API_OAuth2_Application', $this->object->get_application());
|
||||
$this->assertEquals($this->application, $this->object->get_application());
|
||||
}
|
||||
|
||||
public function testLoad_with_user()
|
||||
{
|
||||
$loaded = API_OAuth2_Account::load_with_user(appbox::get_instance(\bootstrap::getCore()), $this->application, self::$user);
|
||||
$this->assertInstanceOf('API_OAuth2_Account', $loaded);
|
||||
$this->assertEquals($this->object, $loaded);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user