classJUnit
final class JUnit
Reads the verdict of a test run from its JUnit XML reports.
Unsafe, unreadable or malformed reports, reports without executed cases, and any failure, error or skip turn the run into a non-passing result.
Methods§
public function read(list<string> $files, int $exitCode, string $output): TestResultReads the reports of one run.
Parameters
$files | list<string> | The report files the run wrote |
$exitCode | int | The exit code of the run |
$output | string | The run's output, reported when it did not pass |
Returns
TestResult The verdict and the number of executed casesTest cases 12
JUnitTest::testReadCannotPassWithoutExecutedPassingCasescallsJUnitTest::testReadCountsPassingCasescallsJUnitTest::testReadFailsOnANonzeroExitCodecallsJUnitTest::testReadFailsOnDefectscallsJUnitTest::testReadFailsWhenAnyReportFailscallsJUnitTest::testReadLeavesNoLibxmlErrorsBehindcallsJUnitTest::testReadRejectsAnUnsafeLaterReportcallsJUnitTest::testReadRejectsMalformedReportscallsJUnitTest::testReadRejectsUnsafeReportscallsJUnitTest::testReadReportsNoExecutedTestsWithoutReportscallsJUnitTest::testReadReportsNoExecutedTestsWithTheOutputcallsJUnitTest::testReadSumsCasesOfEveryReportcalls
Called from 1
Calls 11
- function-call
file_get_contentsline 33 - function-call
striposline 34 - new TestResult line 35
- function-call
trimline 37 - new
DOMDocumentline 40 - function-call
libxml_use_internal_errorsline 41 - method-call
DOMDocument::loadXML()line 43 - function-call
libxml_clear_errorsline 45 - function-call
in_arrayline 48 - new
DOMXPathline 51 - method-call
DOMXPath::query()line 52
Test cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 12
JUnitTest::testReadCannotPassWithoutExecutedPassingCasescallsJUnitTest::testReadCountsPassingCasescallsJUnitTest::testReadFailsOnANonzeroExitCodecallsJUnitTest::testReadFailsOnDefectscallsJUnitTest::testReadFailsWhenAnyReportFailscallsJUnitTest::testReadLeavesNoLibxmlErrorsBehindcallsJUnitTest::testReadRejectsAnUnsafeLaterReportcallsJUnitTest::testReadRejectsMalformedReportscallsJUnitTest::testReadRejectsUnsafeReportscallsJUnitTest::testReadReportsNoExecutedTestsWithoutReportscallsJUnitTest::testReadReportsNoExecutedTestsWithTheOutputcallsJUnitTest::testReadSumsCasesOfEveryReportcalls
Other tests reaching this symbol 3
BehatRunnerTestcallsPhpUnitRunnerTestcallsProcessRunnerTestcalls