From eccff949d66a03d10796b62e904a619ee062891f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 Feb 2024 15:34:19 +0100 Subject: [PATCH] Mutualize code --- test/phpunit/AssetModelTest.php | 81 ---------------------- test/phpunit/BOMTest.php | 80 ---------------------- test/phpunit/BankAccountTest.php | 80 ---------------------- test/phpunit/BarcodeTest.php | 81 ---------------------- test/phpunit/BonPrelevementTest.php | 79 ---------------------- test/phpunit/BuildDocTest.php | 65 ------------------ test/phpunit/CMailFileTest.php | 82 ---------------------- test/phpunit/CategorieTest.php | 79 ---------------------- test/phpunit/ChargeSocialesTest.php | 79 ---------------------- test/phpunit/CodingPhpTest.php | 80 ---------------------- test/phpunit/CodingSqlTest.php | 80 ---------------------- test/phpunit/CommandeFournisseurTest.php | 80 ---------------------- test/phpunit/CommandeTest.php | 67 ------------------ test/phpunit/CommonInvoiceTest.php | 82 +--------------------- test/phpunit/CommonObjectTest.php | 84 +---------------------- test/phpunit/CompanyBankAccountTest.php | 80 ---------------------- test/phpunit/CompanyLibTest.php | 79 ---------------------- test/phpunit/ContactTest.php | 80 ---------------------- test/phpunit/ContratTest.php | 79 ---------------------- test/phpunit/CoreTest.php | 80 ---------------------- test/phpunit/DateLibTest.php | 82 ---------------------- test/phpunit/DateLibTzFranceTest.php | 65 ------------------ test/phpunit/DiscountTest.php | 80 ---------------------- test/phpunit/DoliDBTest.php | 80 ---------------------- test/phpunit/EmailCollectorTest.php | 80 ---------------------- test/phpunit/EntrepotTest.php | 86 ------------------------ test/phpunit/EvalMathTest.php | 81 ---------------------- test/phpunit/ExpenseReportTest.php | 80 ---------------------- test/phpunit/ExportTest.php | 79 ---------------------- test/phpunit/FactureFournisseurTest.php | 79 ---------------------- test/phpunit/FactureRecTest.php | 80 ---------------------- test/phpunit/FactureTest.php | 66 ------------------ test/phpunit/FactureTestRounding.php | 82 ---------------------- test/phpunit/FichinterTest.php | 79 ---------------------- test/phpunit/FilesLibTest.php | 80 ---------------------- test/phpunit/FormAdminTest.php | 80 ---------------------- test/phpunit/FormTest.php | 80 ---------------------- test/phpunit/Functions2LibTest.php | 80 ---------------------- test/phpunit/FunctionsLibTest.php | 70 ------------------- test/phpunit/GetUrlLibTest.php | 80 ---------------------- 40 files changed, 3 insertions(+), 3143 deletions(-) diff --git a/test/phpunit/AssetModelTest.php b/test/phpunit/AssetModelTest.php index dffe1c43069..095152d9990 100644 --- a/test/phpunit/AssetModelTest.php +++ b/test/phpunit/AssetModelTest.php @@ -50,87 +50,6 @@ $langs->load("main"); */ class AssetModelTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return AssetModelTest - */ - 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"; - } - - /** - * Global test setup - * - * @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"; - } - - /** - * Unit test setup - * - * @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"; - } - - /** - * Unit test teardown - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - - /** - * Global test teardown - * - * @return void - */ - public static function tearDownAfterClass(): void - { - global $conf, $user, $langs, $db; - $db->rollback(); - - print __METHOD__."\n"; - } - - /** * testAssetModelCreate * diff --git a/test/phpunit/BOMTest.php b/test/phpunit/BOMTest.php index f37956459ea..c4f014011ca 100644 --- a/test/phpunit/BOMTest.php +++ b/test/phpunit/BOMTest.php @@ -49,86 +49,6 @@ $langs->load("main"); */ class BOMTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return BOMTest - */ - 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"; - } - /** * testBOMCreate * diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index fa040bb61c0..a64855f0cdf 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -51,86 +51,6 @@ $langs->load("main"); */ class BankAccountTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return BankAccountTest - */ - 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"; - } - /** * testBankAccountCreate * diff --git a/test/phpunit/BarcodeTest.php b/test/phpunit/BarcodeTest.php index dc0713c3d72..35fdceb307b 100644 --- a/test/phpunit/BarcodeTest.php +++ b/test/phpunit/BarcodeTest.php @@ -50,87 +50,6 @@ $langs->load("main"); */ class BarcodeTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return BarcodeTest - */ - 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"; - } - - /** * testBarcodeZATCAEncode * diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index 7f0ac84ab8b..d50c65e4bc5 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -50,85 +50,6 @@ $langs->load("main"); */ class BonPrelevementTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return BankAccountTest - */ - 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"; - } - /** * testBonPrevelementCreate * diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index cf8d3b81c5b..2285830032d 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -78,34 +78,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class BuildDocTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return BuildDocTest - */ - 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 * @@ -151,43 +123,6 @@ class BuildDocTest extends CommonClassTest 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"; - } /** * testFactureBuild diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index 2df98a82c03..bf3651226f6 100644 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -49,88 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; */ class CMailFileTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CMailFile - */ - 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; - - $conf->global->MAIN_DISABLE_ALL_MAILS = 1; // If I comment/remove this lien, unit test still works alone but failed when ran from AllTest. Don't know why. - - print __METHOD__ . "\n"; - } - - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__ . "\n"; - } - /** * testCMailFileText * diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 7b29dde7444..fb64673f05f 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -49,85 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CategorieTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CategorieTest - */ - 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"; - } - /** * testCategorieCreate * diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index d3582411af0..d86f6edaa1f 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -48,85 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ChargeSocialesTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ChargeSocialesTest - */ - 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"; - } - /** * testChargeSocialesCreate * diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index da34a0768c2..bdb352dc9f4 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -80,86 +80,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CodingPhpTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return SecurityTest - */ - 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"; - } - /** * testPHP * diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index de4760ca3c4..8d043fe3183 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -80,86 +80,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CodingSqlTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return SecurityTest - */ - 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"; - } - /** * testEscape * diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 3447c4c5450..8d17b274d11 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -50,86 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CommandeFournisseurTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CommandeFournisseurTest - */ - 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"; - //print $db->getVersion()."\n"; - } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testCommandeFournisseurCreate * diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index 93adef4aa82..f0036f6674a 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -48,34 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CommandeTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CommandeTest - */ - 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 * @@ -94,45 +66,6 @@ class CommandeTest extends CommonClassTest 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"; - //print $db->getVersion()."\n"; - } - - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } /** * testCommandeCreate diff --git a/test/phpunit/CommonInvoiceTest.php b/test/phpunit/CommonInvoiceTest.php index ad16970ceb6..0ed7753ed5a 100644 --- a/test/phpunit/CommonInvoiceTest.php +++ b/test/phpunit/CommonInvoiceTest.php @@ -48,88 +48,8 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CommonInvoiceTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CommonObjectTest - */ - 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"; - } - - - /** - * testFetchUser + * testCalculateDateLimReglement * * @return void */ diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 125494ab8eb..ee886e4ae9e 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -49,86 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CommonObjectTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CommonObjectTest - */ - 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"; - } - - /** * testFetchUser * @@ -153,11 +73,11 @@ class CommonObjectTest extends CommonClassTest } /** - * testFetchProjet + * testFetchProject * * @return void */ - public function testFetchProjet() + public function testFetchProject() { global $conf,$user,$langs,$db; $conf=$this->savconf; diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 9bf674724fb..9e412175e4c 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CompanyBankAccountTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CompanyBankAccountTest - */ - 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"; - //print $db->getVersion()."\n"; - } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testCompanyBankAccountCreate * diff --git a/test/phpunit/CompanyLibTest.php b/test/phpunit/CompanyLibTest.php index 67fe02b6e32..81c22882c91 100644 --- a/test/phpunit/CompanyLibTest.php +++ b/test/phpunit/CompanyLibTest.php @@ -48,85 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class CompanyLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return AdminLibTest - */ - 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"; - } - /** * testNameCurrency * diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index 6713b158e06..391905ce2ac 100644 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -56,86 +56,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ContactTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ContactTest - */ - 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"; - } - /** * testContactCreate * diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 03db4ac7097..4f8d681f044 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -48,85 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ContratTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ContratTest - */ - 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"; - } - /** * testContratCreate * diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index 6a3a02ea31c..6149fb159de 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -73,86 +73,6 @@ if (! defined("NOLOGIN")) { */ class CoreTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CoreTest - */ - 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"; - } - - /** * testDetectURLROOT * diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 7c03aa2d72d..789673b7386 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -52,88 +52,6 @@ print "\n"; */ class DateLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return DateLibTest - */ - 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; - - $langs->load("admin"); - - 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"; - } - /** * testNumBetweenDay * diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index b52bed1febd..3af26d0c9fd 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -48,34 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class DateLibTzFranceTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return DateLibTest - */ - 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 * @@ -97,43 +69,6 @@ class DateLibTzFranceTest extends CommonClassTest 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"; - } /** * testDolPrintDateTzFrance diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index 2e717a155d1..147f6ec1362 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class DiscountTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return DiscountTest - */ - 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"; - //print $db->getVersion()."\n"; - } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testDiscountCreate * diff --git a/test/phpunit/DoliDBTest.php b/test/phpunit/DoliDBTest.php index 399d5287b92..08df8d861e7 100644 --- a/test/phpunit/DoliDBTest.php +++ b/test/phpunit/DoliDBTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class DoliDBTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return DiscountTest - */ - 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"; - //print $db->getVersion()."\n"; - } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testDDLUpdateField * diff --git a/test/phpunit/EmailCollectorTest.php b/test/phpunit/EmailCollectorTest.php index 3bfc051e107..38921da2547 100644 --- a/test/phpunit/EmailCollectorTest.php +++ b/test/phpunit/EmailCollectorTest.php @@ -50,86 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class EmailCollectorTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ExpenseReportTest - */ - 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"; - //print $db->getVersion()."\n"; - } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testEmailCollectorCreate * diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index 23ca9bad777..193e89e5751 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -48,92 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class EntrepotTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return EntrepotTest - */ - 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; - - if (!isModEnabled('stock')) { - print __METHOD__." Module Stock must be enabled.\n"; - die(1); - } - - $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"; - } - /** * testEntrepotCreate * diff --git a/test/phpunit/EvalMathTest.php b/test/phpunit/EvalMathTest.php index 5ea25143819..f4ea02dddbd 100644 --- a/test/phpunit/EvalMathTest.php +++ b/test/phpunit/EvalMathTest.php @@ -47,87 +47,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class EvalMathTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return InventoryTest - */ - 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"; - } - /** * test postfix evaluation function * @return void diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index cf7b90f48ef..e9d6895527c 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -49,86 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ExpenseReportTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ExpenseReportTest - */ - 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"; - //print $db->getVersion()."\n"; - } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testExpenseReportCreate * diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 0793e27fed6..4738d622065 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -73,85 +73,6 @@ if (! defined("NOLOGIN")) { */ class ExportTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ExportTest - */ - 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"; - } - /** * Other tests * diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 76075520606..d80282d9fb3 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -49,85 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FactureFournisseurTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FactureFournisseurTest - */ - 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"; - } - /** * testFactureFournisseurCreate * diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index a6dbf3182a8..6b92f190b86 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -49,86 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FactureRecTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FactureTest - */ - 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"; - } - /** * testFactureRecCreate * diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 701c558ffcc..97c427308b0 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -49,34 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FactureTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FactureTest - */ - 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 * @@ -100,44 +72,6 @@ class FactureTest extends CommonClassTest 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"; - } /** * testFactureCreate diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index ff160173994..6baefca7713 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -47,88 +47,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FactureTestRounding extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FactureTest - */ - 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"; - } - - - /** * testFactureRoundingCreate1 * Test according to page http://wiki.dolibarr.org/index.php/Draft:VAT_calculation_and_rounding#Standard_usage diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index 00c0b8cfdeb..b97ff64606a 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -48,85 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FichinterTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ContratTest - */ - 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"; - } - /** * testFichinterCreate * diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index 699b246c1e6..2677928043f 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -50,86 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; */ class FilesLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FilesLibTest - */ - 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"; - } - - /** * testDolBasename * diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 1946d0c1629..73eaa455961 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FormAdminTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FactureTest - */ - 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"; - } - /** * testSelectPaperFormat * diff --git a/test/phpunit/FormTest.php b/test/phpunit/FormTest.php index 7522e3323f8..b944771c3fe 100644 --- a/test/phpunit/FormTest.php +++ b/test/phpunit/FormTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class FormTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FactureTest - */ - 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"; - } - /** * testSelectProduitsList * diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 22e1f6f31d7..8c817b5dace 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -72,86 +72,6 @@ if (! defined("NOLOGIN")) { */ class Functions2LibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CoreTest - */ - 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"; - } - - /** * testJsUnEscape * diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 74b1c10e0fc..9a18580857c 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -78,36 +78,6 @@ print "\n"; */ class FunctionsLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - protected $savmysoc; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return CoreTest - */ - public function __construct($name = '') - { - parent::__construct($name); - - //$this->sharedFixture - global $conf,$user,$langs,$db,$mysoc; - $this->savconf=$conf; - $this->savuser=$user; - $this->savlangs=$langs; - $this->savdb=$db; - $this->savmysoc=$mysoc; - - print __METHOD__." db->type=".$db->type." user->id=".$user->id; - //print " - db ".$db->db; - print "\n"; - } - /** * setUpBeforeClass * @@ -136,46 +106,6 @@ class FunctionsLibTest extends CommonClassTest print __METHOD__."\n"; } - /** - * tearDownAfterClass - * - * @return void - */ - public static function tearDownAfterClass(): void - { - global $conf,$user,$langs,$db; - //$db->rollback(); - - print __METHOD__."\n"; - } - - /** - * Init phpunit tests. Restore variables before each test. - * - * @return void - */ - protected function setUp(): void - { - global $conf,$user,$langs,$db,$mysoc; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - $mysoc=$this->savmysoc; - - print __METHOD__."\n"; - } - - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testDolCheckFilters diff --git a/test/phpunit/GetUrlLibTest.php b/test/phpunit/GetUrlLibTest.php index 0c67925f27b..5a105bcfdbb 100644 --- a/test/phpunit/GetUrlLibTest.php +++ b/test/phpunit/GetUrlLibTest.php @@ -49,86 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class GetUrlLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return FilesLibTest - */ - 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"; - } - - /** * testGetRootURLFromURL *