Home » PEAR » PEAR » Bug #1903
phpt tests fail under PHP5 (1.3 branch)
Details
| Submitted | 2004-07-17 12:19 UTC |
|---|---|
| From | ahundiak at ingr dot com |
| Status | Wont fix |
| Package | PEAR |
| PHP Version | 5.0.0 |
| OS | NA |
| Roadmaps | (Not assigned) |
Comments
[2004-07-17 12:19 UTC] ahundiak at ingr dot com
Description:
------------
I encountered a few issues while trying to run (under PHP 5.0.0) the basic
PEAR tests.
pear1.phpt,pear2.phpt,pear_error.phpt,pear_error2.phpt,pear_error3.phpt,pear
_error4.phpt
1. The PHP5 version of run-tests.php sets the error handling mode to E_ALL | E_STRICT. You need to edit the script to get rid of E_SCRIPT or override it with a command argument. Otherwise, you get lots' of E_STRICT notices. Note also that the PHP5 version of run-tests.php will not work under PHP4.
2. get_class returns lowercase in PHP4, PHP5 returns the actual classname. Assorted debug messages are now different because of the case change which in turn causes the tests to fail. Since they are only debug messages then simply putting a strtolower call around the classname should be ok. Three spots need adjusting:
a. The PEAR class constructor/destructor methods (in the debug blocks)
b. The PEAR_Error->toString message builder (two spots)
c. pear2.phpt
3. pear_error.phpt has it's own error_handler routine with various standard error type codes hardcoded. Need to add E_STRICT to the list (and just ignore any E_STRICT calls) because the error handler is always called regardless of
the error_reporting setting.
With these adjustments, the 6 tests will pass under PHP4 and PHP5. I have not tried the rest of the pear/tests yet. I am willing to do so and provide patches.
Reproduce code:
---------------
A patch file is available here:
http://www.cerad.org/pear/pear5a.diff.txt
[2004-07-17 12:52 UTC] ahundiak at ingr dot com
BTW, an alternative approach would be to create a tests5 directory and regenerate the expected results. I don't know how many automated scripts are out there that would be impacted by this.