3 namespace Drupal\system\Tests\System;
5 use Drupal\Component\Utility\SafeMarkup;
6 use Drupal\simpletest\WebTestBase;
9 * Confirm that the default mobile meta tags appear as expected.
13 class DefaultMobileMetaTagsTest extends WebTestBase {
15 * Array of default meta tags to insert into the page.
19 protected $defaultMetaTags;
21 protected function setUp() {
23 $this->defaultMetaTags = [
24 'viewport' => '<meta name="viewport" content="width=device-width, initial-scale=1.0" />',
29 * Verifies that the default mobile meta tags are added.
31 public function testDefaultMetaTagsExist() {
33 foreach ($this->defaultMetaTags as $name => $metatag) {
34 $this->assertRaw($metatag, SafeMarkup::format('Default Mobile meta tag "@name" displayed properly.', ['@name' => $name]), 'System');
39 * Verifies that the default mobile meta tags can be removed.
41 public function testRemovingDefaultMetaTags() {
42 \Drupal::service('module_installer')->install(['system_module_test']);
44 foreach ($this->defaultMetaTags as $name => $metatag) {
45 $this->assertNoRaw($metatag, SafeMarkup::format('Default Mobile meta tag "@name" removed properly.', ['@name' => $name]), 'System');