function HeadLinksTestCase::testHeadLinks
Test the presence of the head links.
File
-
page_manager/
tests/ head_links.test, line 65
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');
}