diff --git a/test/phpunit/ReceptionTest.php b/test/phpunit/ReceptionTest.php index 2e0b50c889d..c0b9977c00e 100644 --- a/test/phpunit/ReceptionTest.php +++ b/test/phpunit/ReceptionTest.php @@ -48,87 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ReceptionTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return SocieteTest - */ - public function __construct($name = '') - { - parent::__construct($name); - - //$this->sharedFixture - global $conf,$user,$langs,$db; - $this->savconf=$conf; - $this->savuser=$user; - $this->savlangs=$langs; - $this->savdb=$db; - - print __METHOD__." db->type=".$db->type." user->id=".$user->id; - //print " - db ".$db->db; - print "\n"; - } - - /** - * setUpBeforeClass - * - * @return void - */ - public static function setUpBeforeClass(): void - { - global $conf,$user,$langs,$db; - - $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - - print __METHOD__."\n"; - } - - /** - * tearDownAfterClass - * - * @return void - */ - public static function tearDownAfterClass(): void - { - global $conf,$user,$langs,$db; - $db->rollback(); - - print __METHOD__."\n"; - } - - /** - * Init phpunit tests - * - * @return void - */ - protected function setUp(): void - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - print __METHOD__."\n"; - } - - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testSocieteCreate * @@ -165,8 +84,8 @@ class ReceptionTest extends CommonClassTest * * Check that a Reception object can be fetched from database. * - * @param int $id The id of an existing Reception object to fetch. - * @return Reception $localobject + * @param int $id The id of an existing Reception object to fetch. + * @return Reception $localobject * * @depends testReceptionCreate */ @@ -187,8 +106,8 @@ class ReceptionTest extends CommonClassTest * * Check that a Reception object can be updated. * - * @param Object $localobject An existing Reception object to update. - * @return Reception a Reception object with data fetched and name changed + * @param Object $localobject An existing Reception object to update. + * @return Reception a Reception object with data fetched and name changed * * @depends testReceptionFetch */ diff --git a/test/phpunit/RepositoryTest.php b/test/phpunit/RepositoryTest.php index 2d494e604ba..98196fb0c01 100644 --- a/test/phpunit/RepositoryTest.php +++ b/test/phpunit/RepositoryTest.php @@ -79,87 +79,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class RepositoryTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return RepositoryTest - */ - 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"; - } - - /** * testJqueryOnce * diff --git a/test/phpunit/RestAPIContactTest.php b/test/phpunit/RestAPIContactTest.php index 8b4c539ab3b..d618775b141 100644 --- a/test/phpunit/RestAPIContactTest.php +++ b/test/phpunit/RestAPIContactTest.php @@ -50,41 +50,9 @@ $conf->global->MAIN_UMASK='0666'; */ class RestAPIContactTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; protected $api_url; protected $api_key; - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return RestAPIContactTest - */ - public function __construct($name = '') - { - parent::__construct($name); - - //$this->sharedFixture - global $conf,$user,$langs,$db; - $this->savconf=$conf; - $this->savuser=$user; - $this->savlangs=$langs; - $this->savdb=$db; - - if (!isModEnabled('api')) { - print __METHOD__." module api must be enabled.\n"; - die(1); - } - - print __METHOD__." db->type=".$db->type." user->id=".$user->id; - //print " - db ".$db->db; - print "\n"; - } - /** * setUpBeforeClass * @@ -95,18 +63,10 @@ class RestAPIContactTest extends CommonClassTest global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - print __METHOD__."\n"; - } - - /** - * tearDownAfterClass - * - * @return void - */ - public static function tearDownAfterClass(): void - { - global $conf,$user,$langs,$db; - $db->rollback(); + if (!isModEnabled('api')) { + print __METHOD__." module api must be enabled.\n"; + die(1); + } print __METHOD__."\n"; } @@ -146,16 +106,6 @@ class RestAPIContactTest extends CommonClassTest print __METHOD__." api_key: $this->api_key \n"; } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testRestGetContact diff --git a/test/phpunit/RestAPIDocumentTest.php b/test/phpunit/RestAPIDocumentTest.php index ca692520879..172f6953ccb 100644 --- a/test/phpunit/RestAPIDocumentTest.php +++ b/test/phpunit/RestAPIDocumentTest.php @@ -49,36 +49,9 @@ $conf->global->MAIN_UMASK = '0666'; */ class RestAPIDocumentTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; protected $api_url; protected $api_key; - /** - * Constructor - * We save global variables into local variables. - * - * @param string $name Name - * @return RestAPIDocumentTest - */ - public function __construct($name = '') - { - parent::__construct($name); - - //$this->sharedFixture - global $conf,$user,$langs,$db; - $this->savconf = $conf; - $this->savuser = $user; - $this->savlangs = $langs; - $this->savdb = $db; - - echo __METHOD__.' db->type='.$db->type.' user->id='.$user->id; - //print " - db ".$db->db; - echo "\n"; - } - /** * setUpBeforeClass * @@ -89,18 +62,10 @@ class RestAPIDocumentTest extends CommonClassTest global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - echo __METHOD__."\n"; - } - - /** - * tearDownAfterClass - * - * @return void - */ - public static function tearDownAfterClass(): void - { - global $conf,$user,$langs,$db; - $db->rollback(); + if (!isModEnabled('api')) { + print __METHOD__." module api must be enabled.\n"; + die(1); + } echo __METHOD__."\n"; } @@ -140,16 +105,6 @@ class RestAPIDocumentTest extends CommonClassTest echo __METHOD__." api_key: $this->api_key \n"; } - /** - * End phpunit tests. - * - * @return void - */ - protected function tearDown(): void - { - echo __METHOD__."\n"; - } - /** * testPushDocument. * diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index 9ba511571c3..ffacf6f804f 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -50,41 +50,9 @@ $conf->global->MAIN_UMASK='0666'; */ class RestAPIUserTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; protected $api_url; protected $api_key; - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return RestAPIUserTest - */ - public function __construct($name = '') - { - parent::__construct($name); - - //$this->sharedFixture - global $conf,$user,$langs,$db; - $this->savconf=$conf; - $this->savuser=$user; - $this->savlangs=$langs; - $this->savdb=$db; - - if (!isModEnabled('api')) { - print __METHOD__." module api must be enabled.\n"; - die(1); - } - - print __METHOD__." db->type=".$db->type." user->id=".$user->id; - //print " - db ".$db->db; - print "\n"; - } - /** * setUpBeforeClass * @@ -95,18 +63,10 @@ class RestAPIUserTest extends CommonClassTest global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - print __METHOD__."\n"; - } - - /** - * tearDownAfterClass - * - * @return void - */ - public static function tearDownAfterClass(): void - { - global $conf,$user,$langs,$db; - $db->rollback(); + if (!isModEnabled('api')) { + print __METHOD__." module api must be enabled.\n"; + die(1); + } print __METHOD__."\n"; } @@ -146,16 +106,6 @@ class RestAPIUserTest extends CommonClassTest print __METHOD__." api_key: $this->api_key \n"; } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testRestGetUser diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index 507f76e3d20..05550cb381d 100644 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -80,86 +80,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ScriptsTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ScriptsTest - */ - 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"; - } - /** * testBank * diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index bf2c62a5743..cf894c687e2 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -75,90 +75,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class SecurityTest 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(); - - // Restore value to a neutral value (it was set to a test value by some tests) - unset($_SERVER["PHP_SELF"]); - - 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"; - } - /** * testSetLang * diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 85b36e4d875..d6f3bbc54b4 100644 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -50,34 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class SocieteTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return SocieteTest - */ - public function __construct($name = '') - { - parent::__construct($name); - - //$this->sharedFixture - global $conf,$user,$langs,$db; - $this->savconf=$conf; - $this->savuser=$user; - $this->savlangs=$langs; - $this->savdb=$db; - - print __METHOD__." db->type=".$db->type." user->id=".$user->id; - //print " - db ".$db->db; - print "\n"; - } - /** * setUpBeforeClass * @@ -107,45 +79,6 @@ class SocieteTest 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"; - } - /** * testSocieteCreate * diff --git a/test/phpunit/StripeTest.php b/test/phpunit/StripeTest.php index 5e7d15f87cc..028fe821749 100644 --- a/test/phpunit/StripeTest.php +++ b/test/phpunit/StripeTest.php @@ -49,34 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class StripeTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return StripeTest - */ - 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 StripeTest 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"; - } /** * testStripeOk diff --git a/test/phpunit/SupplierProposalTest.php b/test/phpunit/SupplierProposalTest.php index ca416ca1c73..2b81e3f2b19 100644 --- a/test/phpunit/SupplierProposalTest.php +++ b/test/phpunit/SupplierProposalTest.php @@ -51,34 +51,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class SupplierProposalTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return SupplierProposalTest - */ - 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,19 +69,6 @@ class SupplierProposalTest 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 * @@ -131,16 +90,6 @@ class SupplierProposalTest extends CommonClassTest $user->getrights('supplier_proposal', 1); } - /** - * End phpunit tests - * - * @return void - */ - protected function tearDown(): void - { - print __METHOD__."\n"; - } - /** * testSupplierProposalCreate * diff --git a/test/phpunit/TargetTest.php b/test/phpunit/TargetTest.php index 05a7d7bde4f..371933dc5cb 100644 --- a/test/phpunit/TargetTest.php +++ b/test/phpunit/TargetTest.php @@ -50,87 +50,6 @@ $langs->load("main"); */ class TargetTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return TargetTest - */ - 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"; - } - - /** * testTargetCreate * diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index 3d7660fde6d..440de0d0967 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -49,85 +49,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class TicketTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return TicketTest - */ - 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"; - } - /** * testTicketCreate * diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index 6985f894270..7009ec4b47c 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class UserGroupTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return UserGroupTest - */ - 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"; - } - /** * testUserGroupCreate * diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index 30087bf1756..9ea0279e7d3 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -48,34 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class UserTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return UserTest - */ - 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,45 +67,6 @@ class UserTest 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"; - } - /** * testUserCreate * diff --git a/test/phpunit/UtilsTest.php b/test/phpunit/UtilsTest.php index 25dc875e512..b5438325f64 100644 --- a/test/phpunit/UtilsTest.php +++ b/test/phpunit/UtilsTest.php @@ -48,87 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class UtilsTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return UserTest - */ - 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"; - } - /** * testExecuteCLI * diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index c0e373d55ff..e545308b364 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -51,10 +51,6 @@ $conf->global->MAIN_UMASK='0666'; */ class WebservicesInvoicesTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; protected $soapclient; private static $socid; @@ -148,45 +144,6 @@ class WebservicesInvoicesTest 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"; - } - /** * testWSInvoicesCreateInvoice diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index 7b06494675e..afff54501d5 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -51,87 +51,6 @@ $conf->global->MAIN_UMASK='0666'; */ class WebservicesOrdersTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return WebservicesOrdersTest - */ - 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"; - } - - /** * testWSOrderGetOrder * diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index 4366a3e2f9a..08a722e927d 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -51,87 +51,6 @@ $conf->global->MAIN_UMASK='0666'; */ class WebservicesOtherTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return WebservicesOtherTest - */ - 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"; - } - - /** * testWSOtherGetVersions * diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index f7ad10b4e6b..25fb305405e 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -57,87 +57,6 @@ if (!isModEnabled('service')) { */ class WebservicesProductsTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return WebservicesProductsTest - */ - 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"; - } - - /** * testWSProductsCreateProductOrService * diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 8e3b7b1aee2..0fc1c91858c 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -51,17 +51,11 @@ $conf->global->MAIN_UMASK='0666'; */ class WebservicesThirdpartyTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; protected $soapclient; private $ns='http://www.dolibarr.org/ns/'; - - /** * Constructor * We save global variables into local variables @@ -95,57 +89,6 @@ class WebservicesThirdpartyTest extends CommonClassTest 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"; - } /** * testWSThirdpartycreateThirdParty diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index a71bea17731..d6162425bd6 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -51,87 +51,6 @@ $conf->global->MAIN_UMASK='0666'; */ class WebservicesUserTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return WebservicesUserTest - */ - 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"; - } - - /** * testWSUserGetUser * diff --git a/test/phpunit/WebsiteTest.php b/test/phpunit/WebsiteTest.php index 754c15711be..cac8dcfee68 100644 --- a/test/phpunit/WebsiteTest.php +++ b/test/phpunit/WebsiteTest.php @@ -81,87 +81,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class WebsiteTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return WebsiteTest - */ - 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"; - } - - /** * testGetPagesFromSearchCriterias * @@ -169,7 +88,7 @@ class WebsiteTest extends CommonClassTest */ public function testGetPagesFromSearchCriterias() { - global $db, $website; + global $db; $website = new Website($db); // $website must be defined globally for getPagesFromSearchCriterias() diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 54c098a9711..da10f9e9894 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -48,86 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class XCalLibTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return XCalLibTest - */ - 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"; - } - - /** * testQuotedPrintEncodeDecode *