AdminMetaTagTest.php

Same filename in this branch
  1. 11.x core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
Same filename and directory in other branches
  1. 10 core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
  2. 9 core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
  3. 8.9.x core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
  4. main core/modules/system/tests/src/Functional/System/AdminMetaTagTest.php
  5. main core/modules/system/tests/src/Kernel/System/AdminMetaTagTest.php

Namespace

Drupal\Tests\system\Kernel\System

File

core/modules/system/tests/src/Kernel/System/AdminMetaTagTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\system\Kernel\System;

use Drupal\KernelTests\KernelTestBase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Confirm that the fingerprinting meta tag appears as expected.
 */
class AdminMetaTagTest extends KernelTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'system',
  ];
  
  /**
   * Verify that the meta tag HTML is generated correctly.
   */
  public function testMetaTag() : void {
    [$version] = explode('.', \Drupal::VERSION);
    $string = '<meta name="Generator" content="Drupal ' . $version . ' (https://www.drupal.org)" />';
    $this->drupalGet('node');
    $this->assertSession()
      ->responseContains($string);
  }

}

Classes

Title Deprecated Summary
AdminMetaTagTest Confirm that the fingerprinting meta tag appears as expected.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.