diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index b573044d1c4..642e36e37c6 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -80,6 +80,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase protected $savuser; protected $savlangs; protected $savdb; + protected $savmysoc; /** * Constructor @@ -92,11 +93,12 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase parent::__construct(); //$this->sharedFixture - global $conf,$user,$langs,$db; + global $conf,$user,$langs,$db,$mysoc; $this->savconf=$conf; $this->savuser=$user; $this->savlangs=$langs; $this->savdb=$db; + $this->savmysoc=$mysoc; print __METHOD__." db->type=".$db->type." user->id=".$user->id; //print " - db ".$db->db; @@ -142,17 +144,18 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase } /** - * Init phpunit tests + * Init phpunit tests. Restore variables before each test. * * @return void */ protected function setUp(): void { - global $conf,$user,$langs,$db; + global $conf,$user,$langs,$db,$mysoc; $conf=$this->savconf; $user=$this->savuser; $langs=$this->savlangs; $db=$this->savdb; + $mysoc=$this->savmysoc; print __METHOD__."\n"; } @@ -1225,7 +1228,6 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase // We do same tests but with option SERVICE_ARE_ECOMMERCE_200238EC on. $conf->global->SERVICE_ARE_ECOMMERCE_200238EC = 1; - // Test RULE 1 (FR-US) $vat=get_default_tva($companyfr, $companyus, 0); $this->assertEquals(0, $vat, 'RULE 1 ECOMMERCE_200238EC');