From 8d2a3a863da8c6ecd97cceff3e164317834e0022 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Mar 2023 10:48:09 +0100 Subject: [PATCH] Add phpunit for get_localtax_by_third --- test/phpunit/FunctionsLibTest.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 1bf3b6378fb..3b6a4d44942 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -1168,7 +1168,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase } /** - * testGetDefaultTva + * testGetDefaultLocalTax * * @return void */ @@ -1255,6 +1255,27 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase } + /** + * testGetLocalTaxByThird + * + * @return void + */ + public function testGetLocalTaxByThird() + { + global $mysoc; + + $mysoc->country_code = 'ES'; + + $result = get_localtax_by_third(1); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('5.2', $result); + + $result = get_localtax_by_third(2); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('-19:-15:-9', $result); + } + + /** * testDolExplodeIntoArray *