You are here

public function LayoutTest::testThemeProvidedLayout in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php \Drupal\Tests\layout_discovery\Kernel\LayoutTest::testThemeProvidedLayout()

Tests that a layout provided by a theme has the preprocess function set.

File

core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php, line 39

Class

LayoutTest
Tests Layout functionality.

Namespace

Drupal\Tests\layout_discovery\Kernel

Code

public function testThemeProvidedLayout() {
  $this->container
    ->get('theme_installer')
    ->install([
    'test_layout_theme',
  ]);
  $this
    ->config('system.theme')
    ->set('default', 'test_layout_theme')
    ->save();
  $theme_definitions = $this->container
    ->get('theme.registry')
    ->get();
  $this
    ->assertContains('template_preprocess_layout', $theme_definitions['test_layout_theme']['preprocess functions']);
}