From aa66a630e40243bb0fad655ea005ef1813657292 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Jan 2012 08:31:05 +0100 Subject: [PATCH 1/4] Fix: custom directories not in official repository but is used in personnal phpunit test --- test/phpunit/jenkins_phpunittest.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/phpunit/jenkins_phpunittest.xml b/test/phpunit/jenkins_phpunittest.xml index 4a3cb1a914c..2e3165da2f6 100644 --- a/test/phpunit/jenkins_phpunittest.xml +++ b/test/phpunit/jenkins_phpunittest.xml @@ -17,8 +17,6 @@ ../../doc/ ../../test/ ../../htdocs/core/menus/smartphone/ - ../../htdocs/custom/ - ../../htdocs/custom2/ ../../htdocs/products/canvas/ ../../htdocs/contact/canvas/ ../../htdocs/societe/canvas/ @@ -40,8 +38,6 @@ ../../doc/ ../../test/ ../../htdocs/core/menus/smartphone - ../../htdocs/custom/ - ../../htdocs/custom2/ ../../htdocs/products/canvas/ ../../htdocs/contact/canvas/ ../../htdocs/societe/canvas/ From 84fd74b1c75f1cfcea38208d7c0743f2ccf0a848 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Jan 2012 09:04:20 +0100 Subject: [PATCH 2/4] Try to fix unit test From 84d1ef2a8f5c982b7eeced2d9c3b26bd7b9bb9e2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Jan 2012 09:10:49 +0100 Subject: [PATCH 3/4] Fix: float to string --- test/phpunit/PricesTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 4d4c0cbf905..d64a2a5cfb0 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -122,17 +122,17 @@ class PricesTest extends PHPUnit_Framework_TestCase $result1=calcul_price_total(1, 1.24, 0, 10, 0, 0, 0, 'HT', 0); // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) - $this->assertEquals(1.24,$result1[0]); + $this->assertEquals('1.24',$result1[0]); $this->assertEquals(0.12,$result1[1]); - $this->assertEquals(1.36,$result1[2]); + $this->assertEquals('1.36',$result1[2]); - $this->assertEquals(1.24, $result1[3]); + $this->assertEquals('1.24', $result1[3]); $this->assertEquals(0.124,$result1[4]); - $this->assertEquals(1.364,$result1[5]); + $this->assertEquals('1.364',$result1[5]); - $this->assertEquals(1.24,$result1[6]); + $this->assertEquals('1.24',$result1[6]); $this->assertEquals(0.12,$result1[7]); - $this->assertEquals(1.36,$result1[8]); + $this->assertEquals('1.36',$result1[8]); return true; } From d79c9dd17ea6601404f00272d5aa694a440632a2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Jan 2012 09:31:45 +0100 Subject: [PATCH 4/4] Fix: add logs --- test/phpunit/PricesTest.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/phpunit/PricesTest.php b/test/phpunit/PricesTest.php index 4d4c0cbf905..39941edfd19 100755 --- a/test/phpunit/PricesTest.php +++ b/test/phpunit/PricesTest.php @@ -121,17 +121,26 @@ class PricesTest extends PHPUnit_Framework_TestCase // qty=1, unit_price=1.24, discount_line=0, vat_rate=10, price_base_type='HT' $result1=calcul_price_total(1, 1.24, 0, 10, 0, 0, 0, 'HT', 0); // result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount) - + + print __METHOD__." value0=1.24 result0=".$result1[0]."\n"; $this->assertEquals(1.24,$result1[0]); + print __METHOD__." value1=0.12 result1=".$result1[1]."\n"; $this->assertEquals(0.12,$result1[1]); + print __METHOD__." value2=1.36 result2=".$result1[2]."\n"; $this->assertEquals(1.36,$result1[2]); - + + print __METHOD__." value3=1.24 result3=".$result1[3]."\n"; $this->assertEquals(1.24, $result1[3]); + print __METHOD__." value4=0.124 result4=".$result1[4]."\n"; $this->assertEquals(0.124,$result1[4]); + print __METHOD__." value5=1.364 result5=".$result1[5]."\n"; $this->assertEquals(1.364,$result1[5]); - + + print __METHOD__." value6=1.24 result6=".$result1[6]."\n"; $this->assertEquals(1.24,$result1[6]); + print __METHOD__." value7=0.12 result7=".$result1[7]."\n"; $this->assertEquals(0.12,$result1[7]); + print __METHOD__." value8=1.36 result8=".$result1[8]."\n"; $this->assertEquals(1.36,$result1[8]); return true;