You are here

public function HeadLinksTestCase::testHeadLinks in Chaos Tool Suite (ctools) 7

Test the presence of the head links.

File

page_manager/tests/head_links.test, line 65
Tests the head links for page manager pages.

Class

HeadLinksTestCase
Test the head links.

Code

public function testHeadLinks() {
  $node = $this
    ->drupalCreateNode();
  $url = 'node/' . $node->nid;
  $this
    ->drupalGet($url);
  $shortlink = $this
    ->xpath('//head//link[@rel="shortlink"]');
  $this
    ->assertEqual(url($url), (string) $shortlink[0]['href'], 'shortlink url found');
  $canonical = $this
    ->xpath('//head//link[@rel="canonical"]');
  $this
    ->assertEqual(url($url), (string) $canonical[0]['href'], 'canonical url found');
}