diff --git a/test/phpunit/BankAccountTest.php b/test/phpunit/BankAccountTest.php index a212ff0317a..f6c135158d5 100644 --- a/test/phpunit/BankAccountTest.php +++ b/test/phpunit/BankAccountTest.php @@ -61,7 +61,9 @@ class BankAccountTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/BonPrelevementTest.php b/test/phpunit/BonPrelevementTest.php index 0124b25e6c6..de0c3be3416 100644 --- a/test/phpunit/BonPrelevementTest.php +++ b/test/phpunit/BonPrelevementTest.php @@ -62,6 +62,8 @@ class BonPrelevementTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 25b7bd15c03..1c8ac48c868 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -89,7 +89,9 @@ class BuildDocTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/CMailFileTest.php b/test/phpunit/CMailFileTest.php index 06f24ba45e0..a1c3aff5641 100755 --- a/test/phpunit/CMailFileTest.php +++ b/test/phpunit/CMailFileTest.php @@ -59,7 +59,9 @@ class CMailFileTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; @@ -103,7 +105,7 @@ class CMailFileTest extends PHPUnit_Framework_TestCase $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"; } /** diff --git a/test/phpunit/CategorieTest.php b/test/phpunit/CategorieTest.php index 574a8d793f9..394267d40e1 100644 --- a/test/phpunit/CategorieTest.php +++ b/test/phpunit/CategorieTest.php @@ -60,7 +60,9 @@ class CategorieTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/ChargeSocialesTest.php b/test/phpunit/ChargeSocialesTest.php index 0836036afa5..8f06564eb1c 100644 --- a/test/phpunit/ChargeSocialesTest.php +++ b/test/phpunit/ChargeSocialesTest.php @@ -60,6 +60,8 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -117,7 +119,7 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesCreate - * + * * @return void */ public function testChargeSocialesCreate() @@ -139,10 +141,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesFetch - * + * * @param int $id Id of social contribution * @return void - * + * * @depends testChargeSocialesCreate * The depends says test is run only if previous is ok */ @@ -164,10 +166,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesValid - * + * * @param Object $localobject Social contribution * @return void - * + * * @depends testChargeSocialesFetch * The depends says test is run only if previous is ok */ @@ -188,10 +190,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesOther - * + * * @param Object $localobject Social contribution * @return void - * + * * @depends testChargeSocialesValid * The depends says test is run only if previous is ok */ @@ -216,10 +218,10 @@ class ChargeSocialesTest extends PHPUnit_Framework_TestCase /** * testChargeSocialesDelete - * + * * @param int $id Social contribution * @return void - * + * * @depends testChargeSocialesOther * The depends says test is run only if previous is ok */ diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 1a11f3fc1c8..921dfb5b691 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -72,7 +72,9 @@ class CodingPhpTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index 0b29b29240d..3e093d5f6a5 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -72,7 +72,9 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/CommandeFournisseurTest.php b/test/phpunit/CommandeFournisseurTest.php index 2d615e0bd06..b2beb41c72b 100644 --- a/test/phpunit/CommandeFournisseurTest.php +++ b/test/phpunit/CommandeFournisseurTest.php @@ -61,7 +61,9 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/CommandeTest.php b/test/phpunit/CommandeTest.php index aaba882cc87..73d0977d7fd 100644 --- a/test/phpunit/CommandeTest.php +++ b/test/phpunit/CommandeTest.php @@ -59,7 +59,9 @@ class CommandeTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/CommonObjectTest.php b/test/phpunit/CommonObjectTest.php index 18f96034fd1..09200a15b91 100644 --- a/test/phpunit/CommonObjectTest.php +++ b/test/phpunit/CommonObjectTest.php @@ -60,7 +60,9 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/CompanyBankAccountTest.php b/test/phpunit/CompanyBankAccountTest.php index 95ea937a017..5c72dca72a0 100644 --- a/test/phpunit/CompanyBankAccountTest.php +++ b/test/phpunit/CompanyBankAccountTest.php @@ -60,6 +60,8 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/CompanyLibTest.php b/test/phpunit/CompanyLibTest.php index 330eb914308..b06879a5fae 100644 --- a/test/phpunit/CompanyLibTest.php +++ b/test/phpunit/CompanyLibTest.php @@ -59,7 +59,9 @@ class CompanyLibTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/ContactTest.php b/test/phpunit/ContactTest.php index cb0f37875b3..b943020efea 100755 --- a/test/phpunit/ContactTest.php +++ b/test/phpunit/ContactTest.php @@ -68,6 +68,8 @@ class ContactTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -207,7 +209,7 @@ class ContactTest extends PHPUnit_Framework_TestCase $localobject->email='newemail@newemail.com'; $localobject->jabberid='New im id'; $localobject->default_lang='es_ES'; - + $result=$localobject->update($localobject->id,$user); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Contact::update error'); diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 5adf002c885..7e7dfb64922 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -60,6 +60,8 @@ class ContratTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index 3a158260e96..43f74c840fe 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -62,7 +62,9 @@ class CoreTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; @@ -290,22 +292,22 @@ class CoreTest extends PHPUnit_Framework_TestCase } // Run tests - + $_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices'; $result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2); $expectedresult=0; $this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1a'); - + $_SERVER["PHP_SELF"]='/DIR WITH SPACE/htdocs/admin/index.php?mainmenu=home&leftmenu=setup&username=weservices;badaction'; $result=test_sql_and_script_inject($_SERVER["PHP_SELF"], 2); $expectedresult=1; $this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 1b'); - + $_GET['aaa']=""; $result=test_sql_and_script_inject($_GET['aaa'], 0); $expectedresult=1; $this->assertEquals($expectedresult, $result, 'Error on test_sql_and_script_inject 2'); - + $_POST['bbb']=""; $result=test_sql_and_script_inject($_POST['bbb'], 2); $expectedresult=1; diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 645993d8659..1290523abc1 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -60,6 +60,8 @@ class DateLibTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/DateLibTzFranceTest.php b/test/phpunit/DateLibTzFranceTest.php index 668af000204..b41688c153f 100644 --- a/test/phpunit/DateLibTzFranceTest.php +++ b/test/phpunit/DateLibTzFranceTest.php @@ -60,6 +60,8 @@ class DateLibTzFranceTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/DiscountTest.php b/test/phpunit/DiscountTest.php index cf4d5033597..724a97e6f3e 100644 --- a/test/phpunit/DiscountTest.php +++ b/test/phpunit/DiscountTest.php @@ -60,6 +60,8 @@ class DiscountTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index e695bff34a3..a1fca65fac7 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -60,6 +60,8 @@ class EntrepotTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/ExpenseReportTest.php b/test/phpunit/ExpenseReportTest.php index b9af3dc1078..9426b2807a9 100644 --- a/test/phpunit/ExpenseReportTest.php +++ b/test/phpunit/ExpenseReportTest.php @@ -60,7 +60,9 @@ class ExpenseReportTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; @@ -151,7 +153,7 @@ class ExpenseReportTest extends PHPUnit_Framework_TestCase $localobject2->initAsSpecimen(); // Init a speciment with lines $localobject2->status = 0; $localobject2->fk_statut = 0; - + $result=$localobject2->create($user); print __METHOD__." result=".$result."\n"; $this->assertGreaterThanOrEqual(0, $result); diff --git a/test/phpunit/ExportTest.php b/test/phpunit/ExportTest.php index 364eaf7568d..d9de0a89eef 100644 --- a/test/phpunit/ExportTest.php +++ b/test/phpunit/ExportTest.php @@ -64,6 +64,8 @@ class ExportTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/FactureFournisseurTest.php b/test/phpunit/FactureFournisseurTest.php index 7985e8f0931..cda7f9d73f2 100644 --- a/test/phpunit/FactureFournisseurTest.php +++ b/test/phpunit/FactureFournisseurTest.php @@ -61,6 +61,8 @@ class FactureFournisseurTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index f7f857fe317..07d728eb0ec 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -61,6 +61,8 @@ class FactureRecTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 8c3d4a2374a..f40348775f3 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -59,7 +59,9 @@ class FactureTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/FactureTestRounding.php b/test/phpunit/FactureTestRounding.php index 5fe0df4e5d0..4ed76d900bf 100644 --- a/test/phpunit/FactureTestRounding.php +++ b/test/phpunit/FactureTestRounding.php @@ -60,6 +60,8 @@ class FactureTestRounding extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/FichinterTest.php b/test/phpunit/FichinterTest.php index baa72b7020a..4d6e1224498 100644 --- a/test/phpunit/FichinterTest.php +++ b/test/phpunit/FichinterTest.php @@ -60,6 +60,8 @@ class FichinterTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index feac8b212ed..4363623adb0 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -61,6 +61,8 @@ class FilesLibTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/FormAdminTest.php b/test/phpunit/FormAdminTest.php index 30c96600210..876e733b56d 100644 --- a/test/phpunit/FormAdminTest.php +++ b/test/phpunit/FormAdminTest.php @@ -60,6 +60,8 @@ class FormAdminTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/Functions2LibTest.php b/test/phpunit/Functions2LibTest.php index 470a570bf6e..87b2eaefe58 100644 --- a/test/phpunit/Functions2LibTest.php +++ b/test/phpunit/Functions2LibTest.php @@ -63,7 +63,9 @@ class Functions2LibTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 77953ed0141..7699a930f07 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -63,7 +63,9 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/HolidayTest.php b/test/phpunit/HolidayTest.php index a04646a8a14..1239cff2f92 100644 --- a/test/phpunit/HolidayTest.php +++ b/test/phpunit/HolidayTest.php @@ -62,6 +62,8 @@ class HolidayTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -201,11 +203,11 @@ class HolidayTest extends PHPUnit_Framework_TestCase $localobject->email='newemail@newemail.com'; $localobject->jabberid='New im id'; $localobject->default_lang='es_ES'; - + $result=$localobject->update($localobject->id,$user); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Holiday::update error'); - + $result=$localobject->update_note($localobject->note_private,'_private'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Holiday::update_note (private) error'); @@ -213,7 +215,7 @@ class HolidayTest extends PHPUnit_Framework_TestCase $result=$localobject->update_note($localobject->note_public, '_public'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0, 'Holiday::update_note (public) error'); - + $newobject=new Holiday($this->savdb); $result=$newobject->fetch($localobject->id); diff --git a/test/phpunit/ImagesLibTest.php b/test/phpunit/ImagesLibTest.php index 41c7005e25d..cc4e6bd7462 100644 --- a/test/phpunit/ImagesLibTest.php +++ b/test/phpunit/ImagesLibTest.php @@ -61,6 +61,8 @@ class ImagesLibTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php index 067b06910c9..0e80b6384e8 100644 --- a/test/phpunit/ImportTest.php +++ b/test/phpunit/ImportTest.php @@ -62,6 +62,8 @@ class ImportTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/JsonLibTest.php b/test/phpunit/JsonLibTest.php index a06db14565c..113d263eca4 100644 --- a/test/phpunit/JsonLibTest.php +++ b/test/phpunit/JsonLibTest.php @@ -62,7 +62,9 @@ class JsonLibTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 76c7a17d779..b9643e3404b 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -72,6 +72,8 @@ class LangTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/MarginsLibTest.php b/test/phpunit/MarginsLibTest.php index e6f130d2e3b..21c07f7c04a 100644 --- a/test/phpunit/MarginsLibTest.php +++ b/test/phpunit/MarginsLibTest.php @@ -60,6 +60,8 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -136,7 +138,7 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase $this->assertEquals(25,$result[1]); print __METHOD__." result[2]=".$result[2]."\n"; $this->assertEquals(20,$result[2]); - + $result=getMarginInfos(10, 10, 19.6, 0, 0, 0, 8); print __METHOD__." result[0]=".$result[0]."\n"; $this->assertEquals(8,$result[0]); @@ -144,7 +146,7 @@ class MarginsLibTest extends PHPUnit_Framework_TestCase $this->assertEquals(12.5,$result[1]); print __METHOD__." result[2]=".$result[2]."\n"; $this->assertEquals(1/9*100,$result[2]); - + return 0; } diff --git a/test/phpunit/ModulesTest.php b/test/phpunit/ModulesTest.php index a4ff51333e0..81e45ae81b6 100755 --- a/test/phpunit/ModulesTest.php +++ b/test/phpunit/ModulesTest.php @@ -59,6 +59,8 @@ class ModulesTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index 826b55851e2..2779b3011d6 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -62,6 +62,8 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 401b7ce0058..f49f4a368ad 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -59,6 +59,8 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -75,7 +77,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase public static function setUpBeforeClass() { 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"; @@ -128,7 +130,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $user=$this->savuser; $langs=$this->savlangs; $db=$this->savdb; - + require_once dirname(__FILE__).'/../../htdocs/compta/facture/class/facture.class.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/facture/mod_facture_mercure.php'; @@ -137,9 +139,9 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $conf->global->FACTURE_ADDON='mercure'; $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}'; - $conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0; + $conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED=0; - $localobject=new Facture($this->savdb); + $localobject=new Facture($this->savdb); $localobject->initAsSpecimen(); $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year $numbering=new mod_facture_mercure(); diff --git a/test/phpunit/PaypalTest.php b/test/phpunit/PaypalTest.php index fb48279cd66..59c28be2177 100644 --- a/test/phpunit/PaypalTest.php +++ b/test/phpunit/PaypalTest.php @@ -61,6 +61,8 @@ class PaypalTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -135,9 +137,9 @@ class PaypalTest extends PHPUnit_Framework_TestCase $urltotest=getPaypalPaymentUrl(1,'free'); print "urltotest=".$urltotest."\n"; - + $result=getURLContent($urltotest, 'GET'); - + print __METHOD__." result=".$result."\n"; $this->assertLessThanOrEqual($result, 0); diff --git a/test/phpunit/PdfDocTest.php b/test/phpunit/PdfDocTest.php index 13cb1b59ae3..0cf37b48762 100644 --- a/test/phpunit/PdfDocTest.php +++ b/test/phpunit/PdfDocTest.php @@ -63,6 +63,8 @@ class PdfDocTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/PgsqlTest.php b/test/phpunit/PgsqlTest.php index 05efcaeb30b..8347bc32905 100644 --- a/test/phpunit/PgsqlTest.php +++ b/test/phpunit/PgsqlTest.php @@ -62,6 +62,8 @@ class PgsqlTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; @@ -167,13 +169,13 @@ class PgsqlTest extends PHPUnit_Framework_TestCase $result=DoliDBPgsql::convertSQLFromMysql($sql); print __METHOD__." result=".$result."\n"; $this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (without SEPARATOR)'); - + // Test GROUP_CONCAT (with SEPARATOR) $sql="SELECT a.b, GROUP_CONCAT(a.c SEPARATOR ',') FROM table GROUP BY a.b"; $result=DoliDBPgsql::convertSQLFromMysql($sql); print __METHOD__." result=".$result."\n"; $this->assertEquals($result, "SELECT a.b, STRING_AGG(a.c, ',') FROM table GROUP BY a.b", 'Test GROUP_CONCAT (with SEPARATOR)'); - + return $result; } } diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index d3b1efaf072..f7c7fa00354 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -67,7 +67,9 @@ class PricesTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/ProductTest.php b/test/phpunit/ProductTest.php index 87f290593f0..125982bd852 100644 --- a/test/phpunit/ProductTest.php +++ b/test/phpunit/ProductTest.php @@ -60,7 +60,9 @@ class ProductTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/ProjectTest.php b/test/phpunit/ProjectTest.php index c2f5d5b8161..ea7cf01c328 100644 --- a/test/phpunit/ProjectTest.php +++ b/test/phpunit/ProjectTest.php @@ -61,6 +61,8 @@ class ProjectTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/PropalTest.php b/test/phpunit/PropalTest.php index 707673e0d0f..23b07c25a26 100644 --- a/test/phpunit/PropalTest.php +++ b/test/phpunit/PropalTest.php @@ -60,6 +60,8 @@ class PropalTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/RestAPIDocumentTest.php b/test/phpunit/RestAPIDocumentTest.php index 7eb485ffbab..74225bea2d3 100644 --- a/test/phpunit/RestAPIDocumentTest.php +++ b/test/phpunit/RestAPIDocumentTest.php @@ -62,7 +62,9 @@ class RestAPIDocumentTest extends PHPUnit_Framework_TestCase */ public function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf = $conf; $this->savuser = $user; diff --git a/test/phpunit/RestAPIUserTest.php b/test/phpunit/RestAPIUserTest.php index d38eb53c5b5..4d461ce235d 100644 --- a/test/phpunit/RestAPIUserTest.php +++ b/test/phpunit/RestAPIUserTest.php @@ -64,7 +64,9 @@ class RestAPIUserTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/ScriptsTest.php b/test/phpunit/ScriptsTest.php index b7916c39d9f..0c49567a4a4 100644 --- a/test/phpunit/ScriptsTest.php +++ b/test/phpunit/ScriptsTest.php @@ -72,6 +72,8 @@ class ScriptsTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php index 288a15c317e..620bbb8d1b6 100644 --- a/test/phpunit/SecurityTest.php +++ b/test/phpunit/SecurityTest.php @@ -72,6 +72,8 @@ class SecurityTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; diff --git a/test/phpunit/SocieteTest.php b/test/phpunit/SocieteTest.php index 31aa98fd082..af924d233a9 100755 --- a/test/phpunit/SocieteTest.php +++ b/test/phpunit/SocieteTest.php @@ -60,7 +60,9 @@ class SocieteTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/UserGroupTest.php b/test/phpunit/UserGroupTest.php index d41eefcbd39..b1e9b3bb43f 100644 --- a/test/phpunit/UserGroupTest.php +++ b/test/phpunit/UserGroupTest.php @@ -59,7 +59,9 @@ class UserGroupTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; @@ -117,7 +119,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupCreate - * + * * @return void */ public function testUserGroupCreate() @@ -139,7 +141,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupFetch - * + * * @param int $id Id of group * @return void * @depends testUserGroupCreate @@ -163,7 +165,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupUpdate - * + * * @param Object $localobject Group * @return void * @depends testUserGroupFetch @@ -187,7 +189,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupAddRight - * + * * @param Object $localobject Object to show * @return void * @depends testUserGroupUpdate @@ -210,7 +212,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupDelRight - * + * * @param Object $localobject Object * @return void * @depends testUserGroupAddRight @@ -233,7 +235,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupOther - * + * * @param Object $localobject Object * @return void * @depends testUserGroupDelRight @@ -261,7 +263,7 @@ class UserGroupTest extends PHPUnit_Framework_TestCase /** * testUserGroupDelete - * + * * @param int $id Id of object * @return void * @depends testUserGroupOther diff --git a/test/phpunit/UserTest.php b/test/phpunit/UserTest.php index b932d2e2221..5cd1035eff8 100644 --- a/test/phpunit/UserTest.php +++ b/test/phpunit/UserTest.php @@ -59,7 +59,9 @@ class UserTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index 07bd95e01f2..94da9907505 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -56,11 +56,11 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase protected $savlangs; protected $savdb; protected $soapclient; - + private static $socid; - + protected $ns = 'http://www.dolibarr.org/ns/'; - + /** * Constructor * We save global variables into local variables @@ -69,13 +69,15 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase */ function __construct() { + parent::__construct(); + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; $this->savlangs=$langs; $this->savdb=$db; - + // Set the WebService URL $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php'; print __METHOD__." create nusoap_client for URL=".$WS_DOL_URL."\n"; @@ -85,7 +87,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase $this->soapclient->soap_defencoding='UTF-8'; $this->soapclient->decodeUTF8(false); } - + print __METHOD__." db->type=".$db->type." user->id=".$user->id; //print " - db ".$db->db; print "\n"; @@ -118,7 +120,7 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase $societe->date_creation=$now; $societe->tva_assuj=0; $societe->particulier=0; - + $societe->create($user); self::$socid = $societe->id; @@ -259,13 +261,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase return $result; } - + /** * testWSInvoicesGetInvoiceByRefExt - * + * * Retrieve an invoice using ref_ext * @depends testWSInvoicesCreateInvoice - * + * * @param array $result Invoice created by create method * @return array Invoice */ @@ -315,13 +317,13 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase return $result; } - + /** * testWSInvoicesUpdateInvoiceByRefExt - * + * * Update an invoice using ref_ext * @depends testWSInvoicesCreateInvoice - * + * * @param array $result invoice created by create method * @return array Invoice */ diff --git a/test/phpunit/WebservicesOrdersTest.php b/test/phpunit/WebservicesOrdersTest.php index e81ee2d3604..bdd4b138803 100644 --- a/test/phpunit/WebservicesOrdersTest.php +++ b/test/phpunit/WebservicesOrdersTest.php @@ -63,7 +63,9 @@ class WebservicesOrdersTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/WebservicesOtherTest.php b/test/phpunit/WebservicesOtherTest.php index e3725c8609c..2feecf7df0e 100644 --- a/test/phpunit/WebservicesOtherTest.php +++ b/test/phpunit/WebservicesOtherTest.php @@ -63,7 +63,9 @@ class WebservicesOtherTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/WebservicesProductsTest.php b/test/phpunit/WebservicesProductsTest.php index e3500a68f5b..0127414627c 100644 --- a/test/phpunit/WebservicesProductsTest.php +++ b/test/phpunit/WebservicesProductsTest.php @@ -70,7 +70,9 @@ class WebservicesProductsTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/WebservicesThirdpartyTest.php b/test/phpunit/WebservicesThirdpartyTest.php index 59907b36194..db7d44b9411 100644 --- a/test/phpunit/WebservicesThirdpartyTest.php +++ b/test/phpunit/WebservicesThirdpartyTest.php @@ -55,12 +55,12 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase protected $savlangs; protected $savdb; protected $soapclient; - + private $_WS_DOL_URL; private $_ns='http://www.dolibarr.org/ns/'; - - - + + + /** * Constructor @@ -70,15 +70,17 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; $this->savlangs=$langs; $this->savdb=$db; - + $this->_WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php'; - + // Set the WebService URL print __METHOD__." create nusoap_client for URL=".$this->_WS_DOL_URL."\n"; $this->soapclient = new nusoap_client($this->_WS_DOL_URL); @@ -148,10 +150,10 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase $user=$this->savuser; $langs=$this->savlangs; $db=$this->savdb; - + $WS_METHOD = 'createThirdParty'; - - + + // Call the WebService method and store its result in $result. $authentication=array( 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, @@ -159,7 +161,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase 'login'=>'admin', 'password'=>'admin', 'entity'=>''); - + $body = array ( "id" => NULL, "ref" => "name", @@ -197,7 +199,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase "vat_used" => "", "vat_number" => "" ); - + // Test URL $result=''; $parameters = array('authentication'=>$authentication, 'thirdparty'=>$body); @@ -217,20 +219,20 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase print $this->soapclient->response; print "\n"; } - + print __METHOD__." result=".$result['result']['result_code']."\n"; $this->assertEquals('OK',$result['result']['result_code']); - $this->assertEquals('name',$result['ref']); - + $this->assertEquals('name',$result['ref']); + return $result; } /** * testWSThirdpartygetThirdPartyById - * + * * Use id to retrieve thirdparty * @depends testWSThirdpartycreateThirdParty - * + * * @param array $result thirdparty created by create method * @return array thirpdarty updated */ @@ -280,18 +282,18 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase $this->assertEquals('0', $result['thirdparty']['status']); $this->assertEquals('1', $result['thirdparty']['client']); $this->assertEquals('0', $result['thirdparty']['supplier']); - - + + return $result; } - + /** * testWSThirdpartygetThirdPartyByRefExt * * Use ref_ext to retrieve thirdparty * * @depends testWSThirdpartycreateThirdParty - * + * * @param array $result thirdparty created by create method * @return array thirdparty */ @@ -303,9 +305,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; $id = $result['id']; - + $WS_METHOD = 'getThirdParty'; - + // Call the WebService method and store its result in $result. $authentication=array( 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, @@ -313,7 +315,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase 'login'=>'admin', 'password'=>'admin', 'entity'=>''); - + // Test URL $result=''; $parameters = array('authentication'=>$authentication, 'id'=>'', 'ref'=>'', 'ref_ext'=>'12'); @@ -334,7 +336,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase print $this->soapclient->response; print "\n"; } - + print __METHOD__." result=".$result['result']['result_code']."\n"; $this->assertEquals('OK',$result['result']['result_code']); $this->assertEquals($id, $result['thirdparty']['id']); @@ -343,11 +345,11 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase $this->assertEquals('0', $result['thirdparty']['status']); $this->assertEquals('1', $result['thirdparty']['client']); $this->assertEquals('0', $result['thirdparty']['supplier']); - - + + return $result; } - + /** * testWSThirdpartydeleteThirdParty * @@ -364,9 +366,9 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase $langs=$this->savlangs; $db=$this->savdb; $id = $result['id']; - + $WS_METHOD = 'deleteThirdParty'; - + // Call the WebService method and store its result in $result. $authentication=array( 'dolibarrkey'=>$conf->global->WEBSERVICES_KEY, @@ -374,7 +376,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase 'login'=>'admin', 'password'=>'admin', 'entity'=>''); - + $result=''; $parameters = array('authentication'=>$authentication, 'id'=>$id, 'ref'=>'', 'ref_ext'=>''); print __METHOD__." call method ".$WS_METHOD."\n"; @@ -395,7 +397,7 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase print __METHOD__." result=".$result['result']['result_code']."\n"; $this->assertEquals('OK',$result['result']['result_code']); - + return $result; } diff --git a/test/phpunit/WebservicesUserTest.php b/test/phpunit/WebservicesUserTest.php index 5098da22e6e..cdd65b7bc7b 100644 --- a/test/phpunit/WebservicesUserTest.php +++ b/test/phpunit/WebservicesUserTest.php @@ -63,7 +63,9 @@ class WebservicesUserTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user; diff --git a/test/phpunit/XCalLibTest.php b/test/phpunit/XCalLibTest.php index 3bbf3469b17..932f68aa18d 100644 --- a/test/phpunit/XCalLibTest.php +++ b/test/phpunit/XCalLibTest.php @@ -59,7 +59,9 @@ class XCalLibTest extends PHPUnit_Framework_TestCase */ function __construct() { - //$this->sharedFixture + parent::__construct(); + + //$this->sharedFixture global $conf,$user,$langs,$db; $this->savconf=$conf; $this->savuser=$user;