From a3b876e5ca5a1977062b5e2e36ea5749060d557b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 Feb 2024 15:50:51 +0100 Subject: [PATCH] Clean code --- test/phpunit/HolidayTest.php | 80 -------------------------- test/phpunit/ImagesLibTest.php | 79 ------------------------- test/phpunit/ImportTest.php | 80 -------------------------- test/phpunit/InventoryTest.php | 81 -------------------------- test/phpunit/JsonLibTest.php | 79 ------------------------- test/phpunit/KnowledgeRecordTest.php | 67 --------------------- test/phpunit/LangTest.php | 80 -------------------------- test/phpunit/LesscTest.php | 80 -------------------------- test/phpunit/LoanTest.php | 80 -------------------------- test/phpunit/MarginsLibTest.php | 79 ------------------------- test/phpunit/ModulesTest.php | 79 ------------------------- test/phpunit/MouvementStockTest.php | 64 +-------------------- test/phpunit/NumberingModulesTest.php | 81 -------------------------- test/phpunit/ODFTest.php | 80 -------------------------- test/phpunit/PaypalTest.php | 66 --------------------- test/phpunit/PdfDocTest.php | 79 ------------------------- test/phpunit/PgsqlTest.php | 80 -------------------------- test/phpunit/PricesTest.php | 80 -------------------------- test/phpunit/ProductTest.php | 66 --------------------- test/phpunit/ProfidLibTest.php | 83 --------------------------- test/phpunit/ProjectTest.php | 80 -------------------------- test/phpunit/PropalTest.php | 80 -------------------------- 22 files changed, 1 insertion(+), 1702 deletions(-) diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index 13bd427c403..cc8c64932f0 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -51,86 +51,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; */ class HolidayTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return HolidayTest - */ - 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"; - } - /** * testHolidayCreate * diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 06f77f6306e..537a6af1629 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -50,85 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ImagesLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ImagesLibTest - */ - 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"; - } - /** * testDolCountNbOfLine * diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 69564511771..6e2bce4335b 100644 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -71,86 +71,6 @@ if (! defined("NOLOGIN")) { */ class ImportTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ImportTest - */ - 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"; - } - - /** * testImportSample1 * diff --git a/test/phpunit/InventoryTest.php b/test/phpunit/InventoryTest.php index a43e6b421e3..4b388e4f24a 100644 --- a/test/phpunit/InventoryTest.php +++ b/test/phpunit/InventoryTest.php @@ -49,87 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class InventoryTest 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"; - } - /** * testInventoryCreate * diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index 876948dcde6..e05e4134836 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -71,85 +71,6 @@ if (! defined("NOLOGIN")) { */ class JsonLibTest 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"; - } - /** * testJsonEncode * diff --git a/test/phpunit/KnowledgeRecordTest.php b/test/phpunit/KnowledgeRecordTest.php index d4ddb17e051..790d5ac1f3e 100644 --- a/test/phpunit/KnowledgeRecordTest.php +++ b/test/phpunit/KnowledgeRecordTest.php @@ -52,34 +52,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS = 1; */ class KnowledgeRecordTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return KnowledgeRecordTest - */ - 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 * @@ -96,45 +68,6 @@ class KnowledgeRecordTest extends CommonClassTest } } - /** - * 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"; - } - /** * testKnowledgeRecordCreate diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index fbf1ab7698c..97ae7a7acad 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -80,86 +80,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class LangTest 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"; - } - /** * testLang * diff --git a/test/phpunit/LesscTest.php b/test/phpunit/LesscTest.php index 672b3bd910e..b4cf7193812 100644 --- a/test/phpunit/LesscTest.php +++ b/test/phpunit/LesscTest.php @@ -80,86 +80,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class LesscTest 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"; - } - /** * testLess * diff --git a/test/phpunit/LoanTest.php b/test/phpunit/LoanTest.php index c586467a057..f9d87e650ad 100644 --- a/test/phpunit/LoanTest.php +++ b/test/phpunit/LoanTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class LoanTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return LoanTest - */ - 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"; - } - /** * testLoanCreate * diff --git a/test/phpunit/MarginsLibTest.php b/test/phpunit/MarginsLibTest.php index f84ee9d0d42..0d5d98080f6 100644 --- a/test/phpunit/MarginsLibTest.php +++ b/test/phpunit/MarginsLibTest.php @@ -48,85 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class MarginsLibTest 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 - * - * @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"; - } - /** * testGetMarginInfos * diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index 9345d7f922b..26ad2ea4369 100644 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -47,85 +47,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ModulesTest 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 - * - * @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"; - } - /** * testModulesInit * diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index ac211946304..0248d24c6ed 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -50,60 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class MouvementStockTest 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 * @@ -124,15 +70,7 @@ class MouvementStockTest extends CommonClassTest print __METHOD__."\n"; } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } + /** * testMouvementCreate diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index b1ebf08bceb..4bc200a04d5 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -47,87 +47,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class NumberingModulesTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return NumberingModulesTest - */ - 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"; - } - /** * testFactureMercure * diff --git a/test/phpunit/ODFTest.php b/test/phpunit/ODFTest.php index 228b970f1f6..41a3a5af0d6 100644 --- a/test/phpunit/ODFTest.php +++ b/test/phpunit/ODFTest.php @@ -49,86 +49,6 @@ $langs->load("main"); */ class ODFTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ODFTest - */ - 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 ODF convertVarToOdf * diff --git a/test/phpunit/PaypalTest.php b/test/phpunit/PaypalTest.php index 423ae18bdf4..1b763784128 100644 --- a/test/phpunit/PaypalTest.php +++ b/test/phpunit/PaypalTest.php @@ -49,34 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class PaypalTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return PaypalTest - */ - 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 * @@ -96,44 +68,6 @@ class PaypalTest 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"; - } /** * testPaypalOk diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 132b6de4d7a..5fc8807af36 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -52,85 +52,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class PdfDocTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return PdfDocTest - */ - 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"; - } - /** * testPdfDocGetLineDesc * diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index 8932deac8b6..58c5c09b3b4 100644 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -51,86 +51,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class PgsqlTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return PgsqlTest - */ - 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"; - } - /** * testConvertSQLFromMysql * diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 7dc2759662e..a8977026689 100644 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -54,86 +54,6 @@ if (getDolGlobalString('MAIN_ROUNDING_RULE_TOT')) { */ class PricesTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - */ - 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 function calcul_price_total * diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 3f7e33487f0..14ca167c9ad 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -48,34 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ProductTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ProductTest - */ - 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 * @@ -95,44 +67,6 @@ class ProductTest 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"; - } /** * testProductCreate diff --git a/test/phpunit/ProfidLibTest.php b/test/phpunit/ProfidLibTest.php index c2ad6bee9ea..f815317e009 100644 --- a/test/phpunit/ProfidLibTest.php +++ b/test/phpunit/ProfidLibTest.php @@ -72,88 +72,6 @@ if (! defined("NOLOGIN")) { */ class ProfidLibTest 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. Restore variables before each test. - * - * @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"; - } - - - /** * testIsValidLuhn * @@ -170,7 +88,6 @@ class ProfidLibTest extends CommonClassTest } - /** * testIsValidSiren * diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index 517a19da5f6..41ef306a923 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -49,86 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ProjectTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ProjectTest - */ - 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"; - } - /** * testProjectCreate * diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 0510e09bb68..15075500914 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class PropalTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return PropalTest - */ - 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"; - } - /** * testPropalCreate *