diff --git a/src/Util/Log/JUnit.php b/src/Util/Log/JUnit.php index f6ba6ed08ae..ee3fd6e15e0 100644 --- a/src/Util/Log/JUnit.php +++ b/src/Util/Log/JUnit.php @@ -62,6 +62,11 @@ final class JUnit extends Printer implements TestListener */ private $testSuiteErrors = [0]; + /** + * @var int[] + */ + private $testSuiteWarnings = [0]; + /** * @var int[] */ @@ -128,7 +133,7 @@ public function addError(Test $test, \Throwable $t, float $time): void public function addWarning(Test $test, Warning $e, float $time): void { $this->doAddFault($test, $e, $time, 'warning'); - $this->testSuiteFailures[$this->testSuiteLevel]++; + $this->testSuiteWarnings[$this->testSuiteLevel]++; } /** @@ -208,6 +213,7 @@ public function startTestSuite(TestSuite $suite): void $this->testSuiteTests[$this->testSuiteLevel] = 0; $this->testSuiteAssertions[$this->testSuiteLevel] = 0; $this->testSuiteErrors[$this->testSuiteLevel] = 0; + $this->testSuiteWarnings[$this->testSuiteLevel] = 0; $this->testSuiteFailures[$this->testSuiteLevel] = 0; $this->testSuiteSkipped[$this->testSuiteLevel] = 0; $this->testSuiteTimes[$this->testSuiteLevel] = 0; @@ -233,6 +239,11 @@ public function endTestSuite(TestSuite $suite): void (string) $this->testSuiteErrors[$this->testSuiteLevel] ); + $this->testSuites[$this->testSuiteLevel]->setAttribute( + 'warnings', + (string) $this->testSuiteWarnings[$this->testSuiteLevel] + ); + $this->testSuites[$this->testSuiteLevel]->setAttribute( 'failures', (string) $this->testSuiteFailures[$this->testSuiteLevel] @@ -252,6 +263,7 @@ public function endTestSuite(TestSuite $suite): void $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel]; $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; + $this->testSuiteWarnings[$this->testSuiteLevel - 1] += $this->testSuiteWarnings[$this->testSuiteLevel]; $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel]; $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; diff --git a/tests/end-to-end/dataprovider-log-xml-isolation.phpt b/tests/end-to-end/dataprovider-log-xml-isolation.phpt index 6c1b8aad04b..1550de0c271 100644 --- a/tests/end-to-end/dataprovider-log-xml-isolation.phpt +++ b/tests/end-to-end/dataprovider-log-xml-isolation.phpt @@ -16,8 +16,8 @@ PHPUnit %s by Sebastian Bergmann and contributors. ..F. 4 / 4 (100%) - - + + diff --git a/tests/end-to-end/dataprovider-log-xml.phpt b/tests/end-to-end/dataprovider-log-xml.phpt index 5953fb01218..bc1d7d3593b 100644 --- a/tests/end-to-end/dataprovider-log-xml.phpt +++ b/tests/end-to-end/dataprovider-log-xml.phpt @@ -15,8 +15,8 @@ PHPUnit %s by Sebastian Bergmann and contributors. ..F. 4 / 4 (100%) - - + + diff --git a/tests/end-to-end/loggers/log-junit-phpt.phpt b/tests/end-to-end/loggers/log-junit-phpt.phpt index d687ce3e3a8..5e783c5032f 100644 --- a/tests/end-to-end/loggers/log-junit-phpt.phpt +++ b/tests/end-to-end/loggers/log-junit-phpt.phpt @@ -17,7 +17,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. . 1 / 1 (100%) - + PHPUnit must look at STDERR when running PHPT tests. diff --git a/tests/end-to-end/loggers/log-junit.phpt b/tests/end-to-end/loggers/log-junit.phpt index f0344f3dd6f..05805ca7ca8 100644 --- a/tests/end-to-end/loggers/log-junit.phpt +++ b/tests/end-to-end/loggers/log-junit.phpt @@ -18,7 +18,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. .FEISRW.FEISRW 14 / 14 (100%) - + PHPUnit\SelfTest\Basic\StatusTest::testFailure