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
diff --git a/web/core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php b/web/core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php
new file mode 100644 (file)
index 0000000..d020368
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+namespace Drupal\Tests\system\Functional\Page;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests default HTML metatags on a page.
+ *
+ * @group Page
+ */
+class DefaultMetatagsTest extends BrowserTestBase {
+
+  /**
+   * Tests meta tags.
+   */
+  public function testMetaTag() {
+    $this->drupalGet('');
+    // Ensures that the charset metatag is on the page.
+    $result = $this->xpath('//meta[@charset="utf-8"]');
+    $this->assertEqual(count($result), 1);
+
+    // Ensure that the charset one is the first metatag.
+    $result = $this->xpath('//meta');
+    $this->assertEqual((string) $result[0]->getAttribute('charset'), 'utf-8');
+
+    // Ensure that the shortcut icon is on the page.
+    $result = $this->xpath('//link[@rel = "shortcut icon"]');
+    $this->assertEqual(count($result), 1, 'The shortcut icon is present.');
+  }
+
+}