You are here

public function TwigEnvironmentTest::register in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php \Drupal\KernelTests\Core\Theme\TwigEnvironmentTest::register()
  2. 9 core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php \Drupal\KernelTests\Core\Theme\TwigEnvironmentTest::register()

File

core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php, line 186

Class

TwigEnvironmentTest
Tests the twig environment.

Namespace

Drupal\KernelTests\Core\Theme

Code

public function register(ContainerBuilder $container) {
  parent::register($container);
  $definition = new Definition('Twig\\Loader\\FilesystemLoader', [
    [
      sys_get_temp_dir(),
    ],
  ]);
  $definition
    ->setPublic(TRUE);
  $container
    ->setDefinition('twig_loader__file_system', $definition)
    ->addTag('twig.loader');
}