PhpUnitJunit loads file in a separate function
This commit is contained in:
parent
3cdedcd972
commit
e4febf6d25
|
@ -17,13 +17,13 @@ class PhpUnitResultJunit extends PhpUnitResult
|
||||||
*/
|
*/
|
||||||
public function parse()
|
public function parse()
|
||||||
{
|
{
|
||||||
$suites = simplexml_load_file($this->outputFile);
|
|
||||||
|
|
||||||
// Reset the parsing variables
|
// Reset the parsing variables
|
||||||
$this->results = [];
|
$this->results = [];
|
||||||
$this->errors = [];
|
$this->errors = [];
|
||||||
$this->failures = 0;
|
$this->failures = 0;
|
||||||
|
|
||||||
|
$suites = $this->loadResultFile();
|
||||||
|
|
||||||
foreach ($suites->xpath('//testcase') as $testCase) {
|
foreach ($suites->xpath('//testcase') as $testCase) {
|
||||||
$this->parseTestcase($testCase);
|
$this->parseTestcase($testCase);
|
||||||
}
|
}
|
||||||
|
@ -127,4 +127,16 @@ class PhpUnitResultJunit extends PhpUnitResult
|
||||||
|
|
||||||
return $msg;
|
return $msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \SimpleXMLElement
|
||||||
|
*/
|
||||||
|
private function loadResultFile()
|
||||||
|
{
|
||||||
|
if (true) {
|
||||||
|
$suites = simplexml_load_file($this->outputFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $suites;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue