DefaultMetatagsTest.php in Drupal 8
File
core/modules/system/tests/src/Functional/Page/DefaultMetatagsTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\Page;
use Drupal\Tests\BrowserTestBase;
class DefaultMetatagsTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
public function testMetaTag() {
$this
->drupalGet('');
$result = $this
->xpath('//meta[@charset="utf-8"]');
$this
->assertCount(1, $result);
$result = $this
->xpath('//meta');
$this
->assertEqual((string) $result[0]
->getAttribute('charset'), 'utf-8');
$result = $this
->xpath('//link[@rel = "shortcut icon"]');
$this
->assertCount(1, $result, 'The shortcut icon is present.');
}
}