You are here

public function NodeViewTest::testHtmlHeadLinks in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/NodeViewTest.php \Drupal\node\Tests\NodeViewTest::testHtmlHeadLinks()

Tests the html head links.

File

core/modules/node/src/Tests/NodeViewTest.php, line 21
Contains \Drupal\node\Tests\NodeViewTest.

Class

NodeViewTest
Tests the node/{node} page.

Namespace

Drupal\node\Tests

Code

public function testHtmlHeadLinks() {
  $node = $this
    ->drupalCreateNode();
  $this
    ->drupalGet($node
    ->urlInfo());
  $result = $this
    ->xpath('//link[@rel = "version-history"]');
  $this
    ->assertEqual($result[0]['href'], $node
    ->url('version-history'));
  $result = $this
    ->xpath('//link[@rel = "edit-form"]');
  $this
    ->assertEqual($result[0]['href'], $node
    ->url('edit-form'));
  $result = $this
    ->xpath('//link[@rel = "canonical"]');
  $this
    ->assertEqual($result[0]['href'], $node
    ->url());
}