3 namespace Drupal\Tests\system\Functional\Page;
5 use Drupal\Tests\BrowserTestBase;
8 * Tests default HTML metatags on a page.
12 class DefaultMetatagsTest extends BrowserTestBase {
17 public function testMetaTag() {
19 // Ensures that the charset metatag is on the page.
20 $result = $this->xpath('//meta[@charset="utf-8"]');
21 $this->assertEqual(count($result), 1);
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');
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.');