Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #11710 PEAR_RunTests has weird ini_settings handling
Submitted: 2007-07-30 19:10 UTC
From: cweiske Assigned: dufuz
Status: Closed Package: PEAR (version 1.6.1)
PHP Version: 5.2.2 OS:
Roadmaps: 1.6.2    
Subscription  


 [2007-07-30 19:10 UTC] cweiske (Christian Weiske)
Description: ------------ PEAR_RunTests::run($file, $ini_settings = '', $test_number = 1) seems to expect the parameter $ini_settings to be a string, as it is used from PEAR_Command_Test#211 and line #252. On line #240 in PEAR_RunTests, $ini_settings is passed unmodified to settings2array() which uses $ini_settings itself as an array. This means that all information in $ini_settings is lost. It seems as if $ini_settings shall contain full php parameters as this is passed to the php command in runPhpUnit() - the same string is used for run() but treated totally different. Further, even if $ini_settings was an array, some settings would get overridden by the default settings defined in PEAR_RunTests::$ini_overwrites. This could be intentional, but I am not sure.

Comments

 [2007-07-30 20:13 UTC] cweiske (Christian Weiske)
As a workaround, I pass an array to run(). If someone fixes the bug, please still accept arrays!
 [2007-07-30 20:19 UTC] ashnazg (Chuck Burgess)
Seems like best option is to have run() just type-check the $ini_settings value that gets passed to it. If it's a string, then parse it into an array... if it's an array, use it as-is...
 [2007-08-16 19:53 UTC] dufuz (Helgi Þormar)
Actually when I look at the old code then overwriting what people pass was the default behavior. In the past people would only pass string for the PHPUnit tests and further down a $ini_settings = array() would occur since now the PHPUnit stuff has it's own function and run doesn't even use it anymore, so basically I opened up this bug (feature ?) when I was doing some refactoring. But I'll look into converting strings into arrays and I shall be keeping the array as default.
 [2007-08-16 23:31 UTC] dufuz (Helgi Þormar)
Please look at http://cvs.php.net/viewvc.cgi/pear-core/PEAR/RunTest.php?r1=1.48&r2=1.49 and tell me if this is acceptable for you. Just use the array format you've been using, I'm not sure if I'll stick with the new array format since when I think about it now, -c and -f only accept one value and thus this format will kinda fall over it self but we'll see :-) the ini_overwrite is intended so that people don't mess around with ini options that can make the test runner it self go bunkers and that you can always expect that the ini values of these settings are the same no matter where you run the test.
 [2007-08-16 23:31 UTC] dufuz (Helgi Þormar)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.