Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / src / Functional / Page / DefaultMetatagsTest.php
1 <?php
2
3 namespace Drupal\Tests\system\Functional\Page;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests default HTML metatags on a page.
9  *
10  * @group Page
11  */
12 class DefaultMetatagsTest extends BrowserTestBase {
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]->getAttribute('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 }