Issues

ZF-2169: testToFloatSetlocale(Zend_Locale_FormatTest) unit tests fails

Description

Error message:


4) testToFloatSetlocale(Zend_Locale_FormatTest)
Failed asserting that two strings are equal.
expected string <1 234,00>
difference      <       x>
got string      <1 234,50>
/usr/local/Zend/ZendFramework/tests/Zend/Locale/FormatTest.php:904
/usr/local/Zend/ZendFramework/tests/AllTests.php:45
/usr/local/Zend/ZendFramework/tests/AllTests.php:61

Comments

Alex, can you please test with the latest revision from trunk ? And change your local "Format.php" within "Zend/Locale/" directory with the here attached one ?

Please return me the debug output for both tests.

THANKS

Debug Version

Without the output of the attached debug version I will not be able to fix this error... If there is no response anymore I will close this one as it seems that it is then already fixed.

As I am not getting response since 27.November my own tests did not show this error I expect that it does no longer exist.

If it does, please reopen and give detail report of the attached debug version.

After adding a line to {{Zend/Locale/FormatTest.php}} that includes the {{TestHelper.php}} script for {{include_path}} specification:

phpunit --verbose Zend_Locale_FormatTest > Zend_Locale_FormatTest.out 2>&1

produced the output:

PHPUnit 3.2.8 by Sebastian Bergmann.

Zend_Locale_FormatTest
.
toNumber
--------
Value :'0'
Locale:''
Renew
Format:'#,##0.###'
Value :'0'
Prec  :''E..
toNumber
--------
Value :'0'
Locale:''
Pattern
Norm  :'0'
Format:'#,##0.###'
Value :'0'
Prec  :''E..
toNumber
--------
Value :'0'
Locale:''
Pattern
Set Pr:'0'
Norm  :'0'
Format:'#,##0.###'
Value :'0'
Prec  :'0'E......
toNumber
--------
Value :'0'
Locale:''
Renew
Format:'#,##0.###'
Value :'0'
Prec  :''E
toNumber
--------
Value :'1.7'
Locale:'en'
Renew
Format:'#,##0.###'
Value :'1.7'
Prec  :''
Precst:'7'
Int   :'1'
Prec1 :'0.7'
Prec2 :'0.7'
Prec3 :'0.7'
Prec4 :'0.7'
Rest  :''
Format:'#,##.7'
Form2 :'1.7'
Form3 :'1.7'
toNumber
--------
Value :'2.3'
Locale:'en'
Renew
Format:'#,##0.###'
Value :'2.3'
Prec  :''
Precst:'3'
Int   :'2'
Prec1 :'0.3'
Prec2 :'0.3'
Prec3 :'0.3'
Prec4 :'0.3'
Rest  :''
Format:'#,##.3'
Form2 :'2.3'
Form3 :'2.3'...
toNumber
--------
Value :'1234.5'
Locale:'fr_FR'
Pattern
Set Pr:'1234.5'
Norm  :'1234.5'
Format:'#,##0.###'
Value :'1234.5'
Prec  :'2'
Precst:'50'
Int   :'1234'
Prec1 :'0.50'
Prec2 :'0.50'
Prec3 :'0.50'
Prec4 :'0.50'
Rest  :''
Format:'#,##,50'
Form2 :'1Â 234,50'
Form3 :'1Â 234,50'
toNumber
--------
Value :'1234.5'
Locale:'en_US'
Pattern
Set Pr:'1234.5'
Norm  :'1234.5'
Format:'#,##0.###'
Value :'1234.5'
Prec  :'2'
Precst:'50'
Int   :'1234'
Prec1 :'0.50'
Prec2 :'0.50'
Prec3 :'0.50'
Prec4 :'0.50'
Rest  :''
Format:'#,##.50'
Form2 :'1,234.50'
Form3 :'1,234.50'.


Time: 2 seconds

There were 4 errors:

1) testToNumber(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:101

2) testToFloat(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/library/Zend/Locale/Format.php:547
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:187

3) testtoInteger(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/library/Zend/Locale/Format.php:599
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:265

4) testToNumberFormat(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:691

FAILURES!
Tests: 19, Errors: 4.

Reopening issue with output from tests

Debug Version for the new release

testing comments....

Darby,

I don't know why now all comments are gone so I try to answer your comment from my memory:

Within my testbed I don't have to add an include... I can run phpunit Zend_Locale_FormatTest instantly. I was also not able to verify the behaviour that the output of "precstr" breaks the test.

Because the I18N core has been rewritten, I had also to change the debug version. The above mentioned problem does now no longer occur.

But the generated output is "VERY" complete. It would be best if you add the debug output as attachment so I can read through it. This new version must be tested with the latest SVN.

Thank you for your help on this one...

Comments should be OK now.

Thanks Wil

I can no longer reproduce the error messages, so it looks like this is fixed for me, too. Attaching latest output just in case it's useful. Thanks, Thomas! :)

I looked through the output and saw no problems. Eighter the changed default behaviour or the new LDML implementation has done it.

Anyhow, because it is fixed with the actual release, I will close this issue.

Fixed with SVN-7357

Relates to [ZF-2272]