diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/src/Tests/CommentLinksTest.php index 3cbec27..7b1f229 100644 --- a/core/modules/comment/src/Tests/CommentLinksTest.php +++ b/core/modules/comment/src/Tests/CommentLinksTest.php @@ -70,7 +70,7 @@ public function testCommentLinks() { 'subject' => $this->randomMachineName(), 'hostname' => '127.0.0.1', 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, - 'comment_body' => array(LanguageInterface::LANGCODE_NOT_SPECIFIED => array($this->randomMachineName())), + 'comment_body' => array(array('value' => $this->randomMachineName())), )); $comment->save(); $this->comment = $comment; @@ -110,14 +110,20 @@ public function testCommentLinks() { ->setComponent('links', array('weight' => -100)) ->save(); $this->drupalGet($this->node->urlInfo()); - $this->assertTrue($this->cssSelect('article > div ul:first-child'), 'Links found before comment body.'); + $element = $this->cssSelect('article.js-comment > div'); + // Get last child element. + $element = end($element[0]); + $this->assertIdentical($element[0]->getName(), 'div', 'Last element is comment body.'); // Change weight to make links go after comment body. entity_get_display('comment', 'comment', 'default') ->setComponent('links', array('weight' => 100)) ->save(); $this->drupalGet($this->node->urlInfo()); - $this->assertTrue($this->cssSelect('article > div ul:last-child'), 'Links found after comment body.'); + $element = $this->cssSelect('article.js-comment > div'); + // Get last child element. + $element = end($element[0]); + $this->assertIdentical($element[0]->getName(), 'ul', 'Last element is comment links.'); // Make sure we can hide node links. entity_get_display('node', $this->node->bundle(), 'default')