Skip to content

Commit 23d0827

Browse files
Clear the libxml error buffer
1 parent c26349a commit 23d0827

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ChangeLog-7.5.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes of the PHPUnit 7.5 release series are documented in this fil
44

55
## [7.5.12] - 2019-MM-DD
66

7+
### Changed
8+
9+
* After each test, `libxml_clear_errors()` is now called (when available) to clear the libxml error buffer
10+
711
### Fixed
812

913
* Fixed [#3694](https://github.com/sebastianbergmann/phpunit/pull/3694): Constructor arguments for `Throwable` and `Exception` are ignored

src/Framework/TestCase.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ public function runBare(): void
916916
$this->unregisterCustomComparators();
917917
$this->cleanupIniSettings();
918918
$this->cleanupLocaleSettings();
919+
$this->cleanupLibXml();
919920

920921
// Perform assertion on output.
921922
if (!isset($e)) {
@@ -2140,4 +2141,11 @@ private function runInSeparateProcess(): bool
21402141
return ($this->runTestInSeparateProcess === true || $this->runClassInSeparateProcess === true) &&
21412142
$this->inIsolation !== true && !$this instanceof PhptTestCase;
21422143
}
2144+
2145+
private function cleanupLibXml(): void
2146+
{
2147+
if (\function_exists('libxml_clear_errors')) {
2148+
\libxml_clear_errors();
2149+
}
2150+
}
21432151
}

0 commit comments

Comments
 (0)