Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IssueXML.php: skip DOCTYPE (fixes cobertura) #87

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

croensch
Copy link

@croensch croensch commented Mar 7, 2024

After adding Cobertura XML report to PHPUnit my phpcb crashed with:

PHP Fatal error: Uncaught TypeError: DOMNode::appendChild(): Argument #1 ($node) must be of type DOMNode, bool given in /var/lib/jenkins/.composer/vendor/mayflower/php-codebrowser/src/PHPCodeBrowser/IssueXML.php:158

This patch skips '<!DOCTYPE coverage SYSTEM ...' (cobertura), which is a DOMNode that can't be imported, and uses the following element instead.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="0.71621621621622" branch-rate="0" lines-covered="371" lines-valid="518" branches-covered="0" branches-valid="0" complexity="264" version="0.4" timestamp="1709828073">

Might want to also check for false but i think this patch is already deterministic and nice.

@croensch croensch force-pushed the croensch-patch-1 branch 2 times, most recently from bc2c68a to 25bded3 Compare March 7, 2024 16:55
skips '<!DOCTYPE coverage SYSTEM ...' (cobertura) and uses the following element instead
@mmoll mmoll merged commit 8803324 into mayflower:master Mar 11, 2024
4 checks passed
@mmoll
Copy link

mmoll commented Mar 11, 2024

@croensch Thanks, do you need a 4.0.1 release with this included?

@croensch
Copy link
Author

@mmoll would be nice but no rush as i only use it optionally in my build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants