forked from Wavyzz/dolibarr
Clean code
This commit is contained in:
@@ -48,87 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
*/
|
||||
class ReceptionTest extends CommonClassTest
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @param string $name Name
|
||||
* @return SocieteTest
|
||||
*/
|
||||
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;
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* setUpBeforeClass
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
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();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testSocieteCreate
|
||||
*
|
||||
@@ -165,8 +84,8 @@ class ReceptionTest extends CommonClassTest
|
||||
*
|
||||
* Check that a Reception object can be fetched from database.
|
||||
*
|
||||
* @param int $id The id of an existing Reception object to fetch.
|
||||
* @return Reception $localobject
|
||||
* @param int $id The id of an existing Reception object to fetch.
|
||||
* @return Reception $localobject
|
||||
*
|
||||
* @depends testReceptionCreate
|
||||
*/
|
||||
@@ -187,8 +106,8 @@ class ReceptionTest extends CommonClassTest
|
||||
*
|
||||
* Check that a Reception object can be updated.
|
||||
*
|
||||
* @param Object $localobject An existing Reception object to update.
|
||||
* @return Reception a Reception object with data fetched and name changed
|
||||
* @param Object $localobject An existing Reception object to update.
|
||||
* @return Reception a Reception object with data fetched and name changed
|
||||
*
|
||||
* @depends testReceptionFetch
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user