2
0
forked from Wavyzz/dolibarr

Clean code

This commit is contained in:
Laurent Destailleur
2024-02-17 16:03:24 +01:00
parent a3b876e5ca
commit c0a094974a
23 changed files with 17 additions and 1645 deletions

View File

@@ -49,36 +49,9 @@ $conf->global->MAIN_UMASK = '0666';
*/
class RestAPIDocumentTest 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 RestAPIDocumentTest
*/
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;
echo __METHOD__.' db->type='.$db->type.' user->id='.$user->id;
//print " - db ".$db->db;
echo "\n";
}
/**
* setUpBeforeClass
*
@@ -89,18 +62,10 @@ class RestAPIDocumentTest extends CommonClassTest
global $conf,$user,$langs,$db;
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
echo __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);
}
echo __METHOD__."\n";
}
@@ -140,16 +105,6 @@ class RestAPIDocumentTest extends CommonClassTest
echo __METHOD__." api_key: $this->api_key \n";
}
/**
* End phpunit tests.
*
* @return void
*/
protected function tearDown(): void
{
echo __METHOD__."\n";
}
/**
* testPushDocument.
*