forked from Wavyzz/dolibarr
Clean code
This commit is contained in:
@@ -50,41 +50,9 @@ $conf->global->MAIN_UMASK='0666';
|
||||
*/
|
||||
class RestAPIUserTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
protected $api_url;
|
||||
protected $api_key;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @param string $name Name
|
||||
* @return RestAPIUserTest
|
||||
*/
|
||||
public function __construct($name = '')
|
||||
{
|
||||
parent::__construct($name);
|
||||
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
if (!isModEnabled('api')) {
|
||||
print __METHOD__." module api must be enabled.\n";
|
||||
die(1);
|
||||
}
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* setUpBeforeClass
|
||||
*
|
||||
@@ -95,18 +63,10 @@ class RestAPIUserTest extends CommonClassTest
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDownAfterClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->rollback();
|
||||
if (!isModEnabled('api')) {
|
||||
print __METHOD__." module api must be enabled.\n";
|
||||
die(1);
|
||||
}
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
@@ -146,16 +106,6 @@ class RestAPIUserTest extends CommonClassTest
|
||||
print __METHOD__." api_key: $this->api_key \n";
|
||||
}
|
||||
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testRestGetUser
|
||||
|
||||
Reference in New Issue
Block a user