diff --git a/test/phpunit/AccountingAccountTest.php b/test/phpunit/AccountingAccountTest.php index 7b770879428..17e60ffa119 100644 --- a/test/phpunit/AccountingAccountTest.php +++ b/test/phpunit/AccountingAccountTest.php @@ -48,34 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class AccountingAccountTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return AccountingAccountTest - */ - 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 * diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index c775ccd02e2..525513aa5a2 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -48,34 +48,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class ActionCommTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return ActionCommTest - */ - 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,6 +66,7 @@ class ActionCommTest extends CommonClassTest print __METHOD__."\n"; } + /** * testActionCommCreate * diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index 4b9a90b5368..96a2a846fac 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -50,34 +50,6 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; */ class AdherentTest extends CommonClassTest { - protected $savconf; - protected $savuser; - protected $savlangs; - protected $savdb; - - /** - * Constructor - * We save global variables into local variables - * - * @param string $name Name - * @return AdherentTest - */ - 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 * @@ -104,43 +76,6 @@ class AdherentTest 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"; - } /** * testAdherentTypeCreate diff --git a/test/phpunit/AdminLibTest.php b/test/phpunit/AdminLibTest.php index b902028cff6..459cc12b09c 100644 --- a/test/phpunit/AdminLibTest.php +++ b/test/phpunit/AdminLibTest.php @@ -49,85 +49,7 @@ $conf->global->MAIN_DISABLE_ALL_MAILS=1; class AdminLibTest extends CommonClassTest { protected $backupGlobalsBlacklist = array('conf', 'user', 'langs', 'db'); - 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"; - } /** * testVersionCompare diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index 63dad2a8eb6..b1a74efd2b0 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -56,7 +56,6 @@ class CommonClassTest extends PHPUnit\Framework\TestCase * We save global variables into local variables * * @param string $name Name - * @return ActionCommTest */ public function __construct($name = '') { @@ -84,11 +83,6 @@ class CommonClassTest extends PHPUnit\Framework\TestCase global $conf,$user,$langs,$db; $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. - if (!isModEnabled('agenda')) { - print __METHOD__." module agenda must be enabled.\n"; - die(1); - } - print __METHOD__."\n"; } diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 8606de117b8..74b1c10e0fc 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -289,7 +289,7 @@ class FunctionsLibTest extends CommonClassTest // An attempt for SQL injection $filter='if(now()=sysdate()%2Csleep(6)%2C0)'; $sql = forgeSQLFromUniversalSearchCriteria($filter); - $this->assertEquals('Filter syntax error - Bad syntax of the search string', $sql); + $this->assertEquals('Filter error - Bad syntax of the search string', $sql); // A real search string $filter='(((statut:=:1) or (entity:in:__AAA__)) and (abc:<:2.0) and (abc:!=:1.23))'; @@ -310,7 +310,7 @@ class FunctionsLibTest extends CommonClassTest // Check that parenthesis are NOT allowed inside the last operand. Very important. $filter = "(t.fieldint:=:(1,2))"; $sql = forgeSQLFromUniversalSearchCriteria($filter); - $this->assertEquals("Filter syntax error - Bad syntax of the search string", $sql); + $this->assertEquals("Filter error - Bad syntax of the search string", $sql); // Check that ' is escaped into the last operand $filter = "(t.fieldstring:=:'aaa'ttt')";