ZF-2034: testConvertTo(Zend_Measure_NumberTest) failing


1.0-Branch, revision 6577:

3) testConvertTo(Zend_Measure_NumberTest) Failed asserting that two strings are equal. expected string <3 â½> difference < ????> got string <3> /home/sebastian/Work/ZendFramework-1.0/tests/Zend/Measure/NumberTest.php:256


Integrated trunk into branch. Please check the latest revision and give us feedback.

1.0-Branch, At revision 6754:

1) testConvertTo(Zend_Measure_NumberTest) Failed asserting that two strings are equal. expected string <3 â½> difference < ????> got string <3> /home/sebastian/Work/ZendFramework-1.0/tests/Zend/Measure/NumberTest.php:256

Seems that this issue depends on ZF-2169.

It would be great if you can test this with the latest trunk and the attached debug file from the other issue.


I seem to have trouble on certain platforms (e.g., trunk SVN r7041 with PHP 5.2.4, PHPUnit 3.2.2 on RHEL4) with a test in {{Zend_Measure_NumberTest}} causing the test suite to halt or spin (e.g., infinite loop?). I ran it as follows under the default {{TestConfiguration.php.dist}}:

phpunit --verbose AllTests > AllTests.ConfigDefault.out 2>&1

Leading output snipped:



The end of the above output is where the test suite halts for me. At this point the phpunit process needs to be terminated, or it just runs ad infinitum without producing output.

I suspected {{testConvertTo()}} to be likely at fault, so I wanted to make a note of it here, rather than create a separate issue. If this is an incorrect assumption, please feel free to use this information to create another issue. I can provide additional information as needed.

Also, a minor thing, [~thomas] comments that this issue depends on [ZF-2169], but the dependency in JIRA shows the other way around.

I can reproduce that (only difference is that I run Ubuntu 6.06)

Nice that everybody responds that he can confirm this issue. But without the debug output I am not able to fix it. I feel a little bit of ignored. ;-)

Darby's test broke at testNumberSetType()... can be seen from the output... this is the fourth test. Sebstian's Line 256 is an empty line within Number-Test.

The class itself calculates with an internal precision of 25. It could be possible that this precision is the reason for the problems... but it degrades to float calculation when no bcmath is avaiable... which should make no performance problems in my eyes.

Anyway... the originate issue is is a problem which I don't quite understand:

The test tries to equal the output with a defined value. The value is 3 but the output is "3 (10)"... but within windows the tests run without reported problems. Within linux there is a difference. So this seems to be the problem of the reported issue.

But again... this has nothing to do with the seen infinite loop.

After some testing I found the reason:

phpunit seems to react different on win* and *nix systems:

$value = '3 ⑽';
testEquals(3, $value);

returns true on windows and false on linux

$value = '3 ⑽';
testEquals('3 ⑽', $value);

returns true on windows and true on linux

I am using 3.1.0 beta2 since several months without problems in the past. I can not verify if it's related to phpunit or some magical windows-php auto-conversion. But I think this is the originate problem.

I fixed now the testbed. So the originate problem should not occur anymore.

Please give SVN-7047 a try and us a response.

I created a own issue for the loop problem... see ZF-2272 for details.

I confirm this issue is fixed for me, though I still experience the hanging ([ZF-2272]).

Thanks, Thomas! :)