diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index f115c11938af525ba127169279d62414960a2390..afed2817910468875cf9fc256f0a5afcbe802c9d 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -184,7 +184,9 @@ abstract class TestCase extends TestCasePhpUnitCompatibility {
 		// fail hard if xml errors have not been cleaned up
 		$errors = libxml_get_errors();
 		libxml_clear_errors();
-		$this->assertEquals([], $errors);
+		if (!empty($errors)) {
+			self::assertEquals([], $errors, "There have been xml parsing errors");
+		}
 
 		\OC\Files\Cache\Storage::getGlobalCache()->clearCache();