Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / system / src / Tests / Page / DefaultMetatagsTest.php
1 <?php
2
3 namespace Drupal\system\Tests\Page;
4
5 use Drupal\simpletest\WebTestBase;
6
7 /**
8  * Tests default HTML metatags on a page.
9  *
10  * @group Page
11  */
12 class DefaultMetatagsTest extends WebTestBase {
13
14   /**
15    * Tests meta tags.
16    */
17   public function testMetaTag() {
18     $this->drupalGet('');
19     // Ensures that the charset metatag is on the page.
20     $result = $this->xpath('//meta[@charset="utf-8"]');
21     $this->assertEqual(count($result), 1);
22
23     // Ensure that the charset one is the first metatag.
24     $result = $this->xpath('//meta');
25     $this->assertEqual((string) $result[0]->attributes()->charset, 'utf-8');
26
27     // Ensure that the shortcut icon is on the page.
28     $result = $this->xpath('//link[@rel = "shortcut icon"]');
29     $this->assertEqual(count($result), 1, 'The shortcut icon is present.');
30   }
31
32 }