File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
PHP/CodeCoverage/Report/XML Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ class PHP_CodeCoverage_Report_XML_Tests
5656{
5757 private $ contextNode ;
5858
59+ private $ codeMap = array (
60+ 0 => 'PASSED ' , // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED
61+ 1 => 'SKIPPED ' , // PHPUnit_Runner_BaseTestRunner::STATUS_SKIPPED
62+ 2 => 'INCOMPLETE ' , // PHPUnit_Runner_BaseTestRunner::STATUS_INCOMPLETE
63+ 3 => 'FAILURE ' , // PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE
64+ 4 => 'ERROR ' , // PHPUnit_Runner_BaseTestRunner::STATUS_ERROR
65+ 5 => 'RISKY ' // PHPUnit_Runner_BaseTestRunner::STATUS_RISKY
66+ );
67+
5968 public function __construct (DOMElement $ context )
6069 {
6170 $ this ->contextNode = $ context ;
@@ -68,8 +77,9 @@ public function addTest($test, $result)
6877 'http://schema.phpunit.de/coverage/1.0 ' , 'test '
6978 )
7079 );
71-
7280 $ node ->setAttribute ('name ' , $ test );
73- $ node ->setAttribute ('result ' , $ result );
81+ $ node ->setAttribute ('result ' , (int )$ result );
82+ $ node ->setAttribute ('status ' , $ this ->codeMap [(int )$ result ]);
83+
7484 }
7585}
You can’t perform that action at this time.
0 commit comments