DisplayVariantTest.php in Drupal 9
File
core/modules/system/tests/src/Functional/Render/DisplayVariantTest.php
View source
<?php
namespace Drupal\Tests\system\Functional\Render;
use Drupal\Tests\BrowserTestBase;
class DisplayVariantTest extends BrowserTestBase {
protected static $modules = [
'display_variant_test',
];
protected $defaultTheme = 'stark';
public function testPageDisplayVariantSelectionEvent() {
$this
->drupalGet('<front>');
$this
->assertSession()
->pageTextContains('A very important, required value.');
$this
->assertSession()
->pageTextContains('Explicitly passed in context.');
$this
->assertSession()
->responseHeaderContains('X-Drupal-Cache-Tags', 'custom_cache_tag');
}
}