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

Bug #17292 Code Coverage in PEAR_RunTest does not work with namespaces
Submitted: 2010-04-04 19:21 UTC
From: sebastian Assigned: sebastian
Status: Closed Package: PEAR (version 1.9.0)
PHP Version: 5.3.2 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2010-04-04 19:21 UTC] sebastian (Sebastian Bergmann)
Description: ------------ When the --FILE-- section of a PHPT file declares a namespace, the generated PHP file is not valid as the namespace declaration is not the first statement. Test script: --------------- --FILE-- <?php namespace NS; Expected result: ---------------- <?php namespace NS; function coverage_shutdown() { $xdebug = var_export(xdebug_get_code_coverage(), true); file_put_contents('/usr/local/src/phpunit/PHPUnit/Tests/Framework/MockObject/namespaced_class.xdebug', $xdebug); xdebug_stop_code_coverage(); } // end coverage_shutdown() register_shutdown_function("coverage_shutdown"); xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); Actual result: -------------- <?php function coverage_shutdown() { $xdebug = var_export(xdebug_get_code_coverage(), true); file_put_contents('/usr/local/src/phpunit/PHPUnit/Tests/Framework/MockObject/namespaced_class.xdebug', $xdebug); xdebug_stop_code_coverage(); } // end coverage_shutdown() register_shutdown_function("coverage_shutdown"); xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); ?><?php namespace NS;

Comments

 [2010-04-04 20:07 UTC] sebastian (Sebastian Bergmann)
 [2010-04-07 10:32 UTC] sebastian (Sebastian Bergmann)
 [2010-04-07 10:32 UTC] sebastian (Sebastian Bergmann)
 [2010-04-07 20:04 UTC] sebastian (Sebastian Bergmann)
-Status: Open +Status: Closed -Assigned To: +Assigned To: sebastian
This bug has been fixed in SVN. 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.