DefaultMobileMetaTagsTest.php in Zircon Profile 8
File
core/modules/system/src/Tests/System/DefaultMobileMetaTagsTest.php
View source
<?php
namespace Drupal\system\Tests\System;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\simpletest\WebTestBase;
class DefaultMobileMetaTagsTest extends WebTestBase {
protected $defaultMetaTags;
protected function setUp() {
parent::setUp();
$this->defaultMetaTags = array(
'viewport' => '<meta name="viewport" content="width=device-width, initial-scale=1.0" />',
);
}
public function testDefaultMetaTagsExist() {
$this
->drupalGet('');
foreach ($this->defaultMetaTags as $name => $metatag) {
$this
->assertRaw($metatag, SafeMarkup::format('Default Mobile meta tag "@name" displayed properly.', array(
'@name' => $name,
)), 'System');
}
}
public function testRemovingDefaultMetaTags() {
\Drupal::service('module_installer')
->install(array(
'system_module_test',
));
$this
->drupalGet('');
foreach ($this->defaultMetaTags as $name => $metatag) {
$this
->assertNoRaw($metatag, SafeMarkup::format('Default Mobile meta tag "@name" removed properly.', array(
'@name' => $name,
)), 'System');
}
}
}