NodeViewTest.php 803 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

/**
 * @file
 * Contains \Drupal\node\Tests\NodeViewTest.
 */

namespace Drupal\node\Tests;

/**
 * Tests the node/{node} page.
 *
13
 * @group node
14 15 16 17 18 19 20 21 22 23
 * @see \Drupal\node\Controller\NodeController
 */
class NodeViewTest extends NodeTestBase {

  /**
   * Tests the html head links.
   */
  public function testHtmlHeadLinks() {
    $node = $this->drupalCreateNode();

24
    $this->drupalGet($node->urlInfo());
25 26

    $result = $this->xpath('//link[@rel = "version-history"]');
27
    $this->assertEqual($result[0]['href'], $node->url('version-history'));
28 29

    $result = $this->xpath('//link[@rel = "edit-form"]');
30
    $this->assertEqual($result[0]['href'], $node->url('edit-form'));
31 32

    $result = $this->xpath('//link[@rel = "canonical"]');
33
    $this->assertEqual($result[0]['href'], $node->url());
34 35 36
  }

}