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

Bug #14977 PEAR/Frontend.php doesn't require_once PEAR.php
Submitted: 2008-11-09 11:06 UTC
From: doconnor Assigned: dufuz
Status: Closed Package: PEAR
PHP Version: 5.2.6 OS:
Roadmaps: 1.8.0alpha1    

 [2008-11-09 11:06 UTC] doconnor (Daniel O'Connor)
Description: ------------ To run the pear_command_packaging unit tests you need pear-1.8.0alpha (CVS). It would be really handy if the PEAR_Command_Packing unit tests skipped informatively if the version of PEAR you had available was too old. See Test script: --------------- pear run-tests Expected result: ---------------- Tests skip informatively Actual result: -------------- 35) /home/clockwerx/pear/PEAR_Command_Packaging/tests/make-rpm-spec/test_option_rpm-pkgname.phpt expected string <tests done> difference <xxxxxxxxxx?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????> got string <Fatal error: Class 'PEAR_Frontend' not found in /home/clockwerx/pear/PEAR_Command_Packaging/tests/ on line 984>


 [2008-11-16 15:51 UTC] timj (Tim Jackson)
I don't know what led you to conclude that PEAR 1.8.0alpha is required, but those tests were written back in PEAR 1.6 days and have not been changed (for better or worse) since then, so 1.8.x is definitely not a requirement.
 [2008-11-16 23:56 UTC] doconnor (Daniel O'Connor)
Whatever PEAR version I had out of the box (and I was pretty sure it was 1.7.*, but I can't remember) - tests failed; because they couldn't find PEAR_Frontend I cvs up'd and built pear from there, and the latest is 1.8.0alpha (according to the package.xml) - so that worked. A possible solution include_once 'PEAR/Frontend.php'; if (!class_exists('PEAR_Frontend')) { die('skip tests - PEAR_Frontend does not appear to be available.'); }
 [2008-11-17 01:28 UTC] cellog (Greg Beaver)
the tests are always intended to be for the current CVS. Use the RELEASE_X_Y_Z tag to run the tests intended for a package version
 [2008-11-17 01:38 UTC] doconnor (Daniel O'Connor)
Greg, any way I can get these unit tests to run without installing CVS PEAR easily then? At the moment, my CI box does CVS update; and pear-core isn't part of it; or in the include_paths. If I make changes like that, unless they end up documented, then they will quickly end up lost. That's why it would be really good if these tests could check the environment they are running in, and skip informatively if they can't execute.
 [2009-02-01 16:53 UTC] doconnor (Daniel O'Connor)
(but it extends it). 90% of the time you don't see it fail, its just the way PHPUnit's test runner works, where PEAR's ... well... includes PEAR.php :) In short: clockwerx@clockwerx-desktop:~/pear-cvs/pear-core/PEAR$ php Frontend.php Fatal error: Class 'PEAR' not found in /home/clockwerx/pear-cvs/pear-core/PEAR/Frontend.php on line 47 Call Stack: 0.0016 98364 1. {main}() /home/clockwerx/pear-cvs/pear-core/PEAR/Frontend.php:0 ... which causes the unit tests to fall over horribly.
 [2009-02-01 16:54 UTC] doconnor (Daniel O'Connor)
(was 'pear_command_packing needs newest PEAR')
 [2009-02-01 16:59 UTC] doconnor (Daniel O'Connor)
Similar: Fatal error: Class 'PEAR_Frontend' not found in /usr/share/php/PEAR/Common.php on line 264
 [2009-02-07 19:14 UTC] dufuz (Helgi Þormar Þorbjörnsson)
-Status: Open +Status: Closed -Assigned To: +Assigned To: dufuz -Roadmap Versions: +Roadmap Versions: 1.8.0alpha1
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.