PhpUnitJunit loads file in a separate function

This commit is contained in:
SimonHeimberg 2018-02-21 17:20:22 +01:00 committed by Dmitry Khomutov
parent 3cdedcd972
commit e4febf6d25
No known key found for this signature in database
GPG key ID: EC19426474B37AAC

View file

@ -17,13 +17,13 @@ class PhpUnitResultJunit extends PhpUnitResult
*/
public function parse()
{
$suites = simplexml_load_file($this->outputFile);
// Reset the parsing variables
$this->results = [];
$this->errors = [];
$this->failures = 0;
$suites = $this->loadResultFile();
foreach ($suites->xpath('//testcase') as $testCase) {
$this->parseTestcase($testCase);
}
@ -127,4 +127,16 @@ class PhpUnitResultJunit extends PhpUnitResult
return $msg;
}
/**
* @return \SimpleXMLElement
*/
private function loadResultFile()
{
if (true) {
$suites = simplexml_load_file($this->outputFile);
}
return $suites;
}
}