This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | AssertionError at org.netbeans.modules.php.project.ui.codecoverage.CoverageVO.setPhpUnitVersion | ||
---|---|---|---|
Product: | php | Reporter: | Jeffrey Rubinoff <jeff_rubinoff> |
Component: | PHPUnit | Assignee: | Ondrej Brejla <obrejla> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alganet, AmLn, andrey_pk, CheeseSucker, cliffordwhansen, fzamboj, geissler, honglibin, jacobsantos, karel_barel, kingsquare, ktx, lucifurious, martinvium, marvin.charles, mmikeyy, n0dwis, nbphpuser, OndrejBrejla, royrogers, Seb147, taleti, TobiasKranz, wgcrouch, Xedecimal, xgathos |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows 7 x64 | ||
Issue Type: | DEFECT | Exception Reporter: | 172877 |
Attachments: |
stacktrace
Patch |
Description
Jeffrey Rubinoff
2010-10-02 19:06:20 UTC
Created attachment 102235 [details]
stacktrace
I'll have a look Exception occurs only when "Code coverage / Collect and Display Code Coverage" is checked I am getting the same error when the code coverage is checked only. I was able to track this down to what might be the cause. The cause is that the new PHP_CodeCoverage does not include the phpunit version. A quick fix might be to remove line http://hg.netbeans.org/main/file/aef6d3cc0966/php.project/src/org/netbeans/modules/php/project/ui/codecoverage/PhpUnitCoverageLogParser.java#l129 or commenting it out at the very least. The real fix would be to use the phpunit class to pull the PHPunit version, since that class should already have the PHPunit version without requiring PHP_CodeCoverage to set it. ------- I'm going to try a work around later today by having PHP_CodeCoverage set the phpunit version manually to the version I'm using. I'll comment back when I do the test. Okay, it has been verified that editing PHP_CodeCoverage to add the phpunit attribute works around Netbeans. Step 1: Find PHP_CodeCoverage path. Depends on whether PEAR was used or if manually installed PEAR. If used PEAR, then it is usually in the PHP directory. PEAR/PHP/CodeCoverage. Step 2: Open Report/Clover.php Step 3: Find line 74 and add {{{$root->setAttribute('phpunit', '3.5.4');}}} Step 4: Save and then run tests again to get code coverage. (In reply to comment #6) > Okay, it has been verified that editing PHP_CodeCoverage to add the phpunit > attribute works around Netbeans. > > Step 1: Find PHP_CodeCoverage path. Depends on whether PEAR was used or if > manually installed PEAR. If used PEAR, then it is usually in the PHP directory. > PEAR/PHP/CodeCoverage. > > Step 2: Open Report/Clover.php > > Step 3: Find line 74 and add {{{$root->setAttribute('phpunit', '3.5.4');}}} > > Step 4: Save and then run tests again to get code coverage. I can confirm this works with PHPunit 3.5.5 :) thanx for the workaround > Step 3: Find line 74 and add {{{$root->setAttribute('phpunit', '3.5.4');}}}
Can you please show where exactly it has to be placed&
(In reply to comment #8) > > Step 3: Find line 74 and add {{{$root->setAttribute('phpunit', '3.5.4');}}} > Can you please show where exactly it has to be placed& Sorry for the extended delay. I'm unsure exactly how to be contacted when there is a comment. I will instead submit a patch, or actually a diff to show where it is. (In reply to comment #8) > > Step 3: Find line 74 and add {{{$root->setAttribute('phpunit', '3.5.4');}}} > Can you please show where exactly it has to be placed& Sorry, I misunderstood that you meant PHP_CodeCoverage. The line is really not what is important. What is important is that you add that line to the coverage attribute. From /PHP/CodeCoverage/Report/Clover.php: > $root = $document->createElement('coverage'); > $root->setAttribute('generated', (int)$_SERVER['REQUEST_TIME']); > $document->appendChild($root); Then add the > $root->setAttribute('phpunit', '3.5.5'); // This can be any number. After the: > $root = $document->createElement('coverage'); > $root->setAttribute('generated', (int)$_SERVER['REQUEST_TIME']); Created attachment 106827 [details]
Patch
I have applied Ondra's patch. Integrated into 'main-golden', will be available in build *201103090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/93a615991d6b User: Petr Pisl <ppisl@netbeans.org> Log: #190725 - AssertionError at org.netbeans.modules.php.project.ui.codecoverage.CoverageVO.setPhpUnitVersion |