diff --git a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php index 25d5c3c..fdcb8f5 100644 --- a/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php +++ b/core/modules/comment/tests/src/Unit/CommentLinkBuilderTest.php @@ -130,12 +130,12 @@ public function testCommentLinkBuilder(NodeInterface $node, $context, $has_acces if (is_array($detail)) { // Array of link attributes. foreach ($detail as $key => $value) { - $this->assertEquals($links['comment__comment']['#links'][$link][$key], $value); + $this->assertEquals($value, $links['comment__comment']['#links'][$link][$key]); } } else { // Just the title. - $this->assertEquals($links['comment__comment']['#links'][$link]['title'], $detail); + $this->assertEquals($detail, $links['comment__comment']['#links'][$link]['title']); } } } @@ -241,7 +241,7 @@ public function getLinkCombinations() { } else { // On a separate page. - $expected['comment-add']['url'] = Url::fromRoute('comment.reply'); + $expected['comment-add']['url'] = Url::fromRoute('comment.reply', ['entity_type' => 'node', 'entity' => 1, 'field_name' => 'comment']); } } } @@ -315,12 +315,7 @@ protected function getMockNode($has_field, $comment_status, $form_location, $com ->method('id') ->willReturn(1); - $url = $this->getMockBuilder('\Drupal\Core\Url') - ->disableOriginalConstructor() - ->getMock(); - $url->expects($this->any()) - ->method('toArray') - ->willReturn(array('route_name' => 'node.view')); + $url = Url::fromRoute('node.view'); $node->expects($this->any()) ->method('urlInfo') ->willReturn($url);