core/modules/comment/src/Tests/CommentTestBase.php | 17 ++++++++++++++++- core/modules/system/system.install | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php index f78a8bd..75efbd4 100644 --- a/core/modules/comment/src/Tests/CommentTestBase.php +++ b/core/modules/comment/src/Tests/CommentTestBase.php @@ -188,7 +188,22 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $ */ function commentExists(CommentInterface $comment = NULL, $reply = FALSE) { if ($comment) { - return (bool) $this->cssSelect('.comment-wrapper ' . ($reply ? '.indented ' : '') . '#comment-' . $comment->id()); + $comment_element = $this->cssSelect('.comment-wrapper ' . ($reply ? '.indented ' : '') . '#comment-' . $comment->id() . ' ~ article'); + if (empty($comment_element)) { + return FALSE; + } + + $comment_title = $comment_element[0]->xpath('div/h3/a'); + if (empty($comment_title) || ((string)$comment_title[0]) !== $comment->getSubject()) { + return FALSE; + } + + $comment_body = $comment_element[0]->xpath('div/div/p'); + if (empty($comment_body) || ((string)$comment_body[0]) !== $comment->comment_body->value) { + return FALSE; + } + + return TRUE; } else { return FALSE; diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 2f155b9..c59765e 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1468,16 +1468,16 @@ function system_update_8005() { default: $custom_themes_installed = TRUE; - $name = sprintf('block.block.%s_local_actions', $theme_name); + $name = 'block.block.' . $theme_name . '_local_actions'; $values = [ - 'id' => sprintf('%s_local_actions', $theme_name), + 'id' => $theme_name . '_local_actions', 'weight' => -10, ] + $local_actions_default_settings; _system_update_create_block($name, $theme_name, $values); $name = sprintf('block.block.%s_local_tasks', $theme_name); $values = [ - 'id' => sprintf('%s_local_tasks', $theme_name), + 'id' => $theme_name . '_local_tasks', 'weight' => -20, ] + $tabs_default_settings; _system_update_create_block($name, $theme_name, $values);