diff --git a/core/modules/system/src/Tests/Menu/LocalActionTest.php b/core/modules/system/src/Tests/Menu/LocalActionTest.php
index 620aed5..468cbbb 100644
--- a/core/modules/system/src/Tests/Menu/LocalActionTest.php
+++ b/core/modules/system/src/Tests/Menu/LocalActionTest.php
@@ -54,6 +54,8 @@ protected function assertLocalAction(array $actions) {
list($url, $title) = $action;
// SimpleXML gives us the unescaped text, not the actual escaped markup,
// so use a pattern instead to check the raw content.
+ // This behaviour is a bug in libxml, see
+ // https://bugs.php.net/bug.php?id=49437.
$this->assertPattern('@]*class="[^"]*button-action[^"]*"[^>]*>' . preg_quote($title, '@') . '@');
$this->assertEqual($elements[$index]['href'], $url->toString());
$index++;
diff --git a/core/modules/system/src/Tests/Menu/LocalTasksTest.php b/core/modules/system/src/Tests/Menu/LocalTasksTest.php
index 79dc5e4..cb6b529 100644
--- a/core/modules/system/src/Tests/Menu/LocalTasksTest.php
+++ b/core/modules/system/src/Tests/Menu/LocalTasksTest.php
@@ -59,6 +59,8 @@ protected function assertLocalTasks(array $routes, $level = 0) {
protected function assertLocalTaskAppers($title) {
// SimpleXML gives us the unescaped text, not the actual escaped markup,
// so use a pattern instead to check the raw content.
+ // This behaviour is a bug in libxml, see
+ // https://bugs.php.net/bug.php?id=49437.
return $this->assertPattern('@]*>' . preg_quote($title, '@') . '@');
}