diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php index bce08d4..8b9ab47 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php @@ -80,7 +80,7 @@ function setUp() { /** * Posts a comment. * - * @param \Drupal\Core\Entity\EntityInterface|null $node + * @param \Drupal\Core\Entity\EntityInterface|null $entity * Node to post comment on or NULL to post to the previously loaded page. * @param $comment * Comment body. @@ -93,7 +93,7 @@ function setUp() { * @return \Drupal\comment\CommentInterface|null * The posted comment or NULL when posted comment was not found. */ - function postComment($node, $comment, $subject = '', $contact = NULL) { + function postComment($entity, $comment, $subject = '', $contact = NULL) { $langcode = Language::LANGCODE_NOT_SPECIFIED; $edit = array(); $edit['comment_body[' . $langcode . '][0][value]'] = $comment; @@ -102,8 +102,8 @@ function postComment($node, $comment, $subject = '', $contact = NULL) { $subject_mode = variable_get('comment_subject_field_article', 1); // Must get the page before we test for fields. - if ($node !== NULL) { - $this->drupalGet('comment/reply/' . $node->id()); + if ($entity !== NULL) { + $this->drupalGet('comment/reply/' . $entity->id()); } if ($subject_mode == TRUE) { @@ -149,8 +149,7 @@ function postComment($node, $comment, $subject = '', $contact = NULL) { } if (isset($match[1])) { - $entity = comment_load($match[1], TRUE); - return $entity; + return comment_load($match[1], TRUE); } }