PHP5,PEAR,run-tests.php

From: Date: Fri, 16 Jul 2004 17:48:37 +0000
Subject: PHP5,PEAR,run-tests.php
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-32107@lists.php.net to get a copy of this message
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 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'll file a bug report but I thought this information might be useful for package developers with existing phpt test suites.

« previous php.pear.dev (#32107) next »