Strange problem with Code Coverage after Updating IDE / WampSever

  • From: "H.Gassner" < >
  • To:
  • Subject: Strange problem with Code Coverage after Updating IDE / WampSever
  • Date: Tue, 10 Jan 2012 20:59:03 +0000

Hi everyone!

I have updated my Netbeans/Wampserver development environment last week. My 
previous versions had been Netbeans 6.9.1 (for PHP) and Wampserver 2.0 (PHP 
5.2.8 / Apache 2.2.8 ). Now I am using Netbeans 7.1 and WampServer 2.2a (PHP 
5.3.8 / Apache 2.2.21 ).

With the old environment I had no troubles using XDebug, XDebug for debugging 
UnitTests and CodeCoverage also worked like a charm.

With the new installation I have two major problems:
- I cannot debug UnitTests anymore (simply does not halt on breakpoints / 
waiting for connection)
- I get no CodeCoverage

The system is running on a Windows 7 machine.

What I found out today:
- running phpunit / code coverage on the command line gives valid results
- running the same UnitTest inside the NetBeans IDE does not work

Here is, what I get in the output window:

Code:
PHPUnit 3.6.7 by Sebastian Bergmann.

Configuration read from 
H:\Daten\HP\work\noXperia\_intern\trunk\test\_Configuration.xml

..........

Time: 0 seconds, Memory: 6.50Mb

OK (10 tests, 51 assertions)

Writing code coverage data to XML file, this may take a moment.

Generating code coverage report, this may take a moment.
Warning: file_get_contents(/E:/NetBeans 7.1/php/phpunit/NetBeansSuite.php): 
failed to open stream: Invalid argument in 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php
 on line 475

Call Stack:
    0.0002     634544   1. {main}() E:\wamp22\bin\php\php5.3.8\phpunit:0
    0.0063    1143184   2. PHPUnit_TextUI_Command::main() 
E:\wamp22\bin\php\php5.3.8\phpunit:46
    0.0064    1143768   3. PHPUnit_TextUI_Command->run() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:125
    0.0688    4523264   4. PHPUnit_TextUI_TestRunner->doRun() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:187
    0.3420    7631936   5. PHP_CodeCoverage_Report_HTML->process() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:373
    0.4203    8078848   6. 
PHP_CodeCoverage_Report_HTML_Renderer_File->render() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML.php:180
    0.4211    8083240   7. 
PHP_CodeCoverage_Report_HTML_Renderer_File->renderSource() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:124
    0.4217    8083880   8. 
PHP_CodeCoverage_Report_HTML_Renderer_File->loadFile() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:348
    0.4217    8083928   9. file_get_contents() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:475


Warning: 
file_get_contents(/H:/Daten/HP/work/_intern/trunk/Balancing.class.php): 
failed to open stream: Invalid argument in 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php
 on line 475

Call Stack:
    0.0002     634544   1. {main}() E:\wamp22\bin\php\php5.3.8\phpunit:0
    0.0063    1143184   2. PHPUnit_TextUI_Command::main() 
E:\wamp22\bin\php\php5.3.8\phpunit:46
    0.0064    1143768   3. PHPUnit_TextUI_Command->run() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:125
    0.0688    4523264   4. PHPUnit_TextUI_TestRunner->doRun() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:187
    0.3420    7631936   5. PHP_CodeCoverage_Report_HTML->process() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:373
    0.5889    8089264   6. 
PHP_CodeCoverage_Report_HTML_Renderer_File->render() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML.php:180
    0.5897    8093656   7. 
PHP_CodeCoverage_Report_HTML_Renderer_File->renderSource() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:124
    0.5903    8094296   8. 
PHP_CodeCoverage_Report_HTML_Renderer_File->loadFile() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:348
    0.5903    8094344   9. file_get_contents() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:475



Generating textual code coverage report, this may take a moment.

Code Coverage Report 
  2012-01-10 20:11:03

 Summary: 
  Classes: 100.00% (0/0)
  Methods: 100.00% (0/0)
  Lines:   100.00% (0/0)

PHP Warning:  file_get_contents(/E:/NetBeans 
7.1/php/phpunit/NetBeansSuite.php): failed to open stream: Invalid argument 
in 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php
 on line 475
PHP Stack trace:
PHP   1. {main}() E:\wamp22\bin\php\php5.3.8\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() E:\wamp22\bin\php\php5.3.8\phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:125
PHP   4. PHPUnit_TextUI_TestRunner->doRun() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:187
PHP   5. PHP_CodeCoverage_Report_HTML->process() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:373
PHP   6. PHP_CodeCoverage_Report_HTML_Renderer_File->render() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML.php:180
PHP   7. PHP_CodeCoverage_Report_HTML_Renderer_File->renderSource() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:124
PHP   8. PHP_CodeCoverage_Report_HTML_Renderer_File->loadFile() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:348
PHP   9. file_get_contents() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:475
PHP Warning:  
file_get_contents(/H:/Daten/HP/work/_intern/trunk/Balancing.class.php): 
failed to open stream: Invalid argument in 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php
 on line 475
PHP Stack trace:
PHP   1. {main}() E:\wamp22\bin\php\php5.3.8\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() E:\wamp22\bin\php\php5.3.8\phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:125
PHP   4. PHPUnit_TextUI_TestRunner->doRun() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:187
PHP   5. PHP_CodeCoverage_Report_HTML->process() 
E:\wamp22\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:373
PHP   6. PHP_CodeCoverage_Report_HTML_Renderer_File->render() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML.php:180
PHP   7. PHP_CodeCoverage_Report_HTML_Renderer_File->renderSource() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:124
PHP   8. PHP_CodeCoverage_Report_HTML_Renderer_File->loadFile() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:348
PHP   9. file_get_contents() 
E:\wamp22\bin\php\php5.3.8\pear\PHP\CodeCoverage\Report\HTML\Renderer\File.php:475



As you can see - errors for the html and xml report, wrong results (100% 
coverage) for the text report.


Running the same test at the command prompt I get valid results for the text 
report:

Code:

E:\wamp22\bin\php\php5.3.8>h:

H:\Daten\HP\work\noXperia\_intern\trunk\test>e:\wamp22\bin\php\php5.3.8\phpunit.
bat --coverage-text BalancingTest.class.php
PHPUnit 3.6.7 by Sebastian Bergmann.

..........

Time: 1 second, Memory: 5.75Mb

OK (10 tests, 51 assertions)

Generating textual code coverage report, this may take a moment.

Code Coverage Report
  2012-01-10 20:09:54

 Summary:
  Classes: 0.00% (0/1)
  Methods: 41.67% (10/24)
  Lines:   15.38% (20/130)

@GameControl::Balancing
  Methods:  45.83% (11/24)   Lines:  15.38% ( 20/130)





My PHP-Unit config-file has the following content:

Code:

<phpunit colors="false" debug="true" verbose="true">
    <php>
        <ini name="memory_limit" value="2048M"/>
    </php>  
    <logging>
        <log type="coverage-html" target="./report" charset="UTF-8" 
            yui="true" highlight="false" lowUpperBound="35" 
highLowerBound="70" />
        <log type="coverage-xml" target="./report/coverage.xml"/>
    </logging>
</phpunit>




I've added --coverage-text to the call of the batch file when using the 
Netbeans IDE.

Any suggestions?

Thank you in advance
Horst






Strange problem with Code Coverage after Updating IDE / WampSever

H.Gassner 01/10/2012

Strange problem with Code Coverage after Updating IDE / WampSever

H.Gassner 01/12/2012

Project Features

About this Project

PHP was started in November 2009, is owned by Petr Jiricka, and has 307 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close