You are here

trait TwigDebugTrait in UI Patterns 8

Provides shortcut to enable Twig debug mode on \Drupal\Tests\BrowserTestBase.

Hierarchy

5 files declare their use of TwigDebugTrait
UiPatternsFieldGroupRenderTest.php in modules/ui_patterns_field_group/tests/src/FunctionalJavascript/UiPatternsFieldGroupRenderTest.php
UiPatternsFieldRenderTest.php in modules/ui_patterns_ds/tests/src/FunctionalJavascript/UiPatternsFieldRenderTest.php
UiPatternsLayoutsRenderTest.php in modules/ui_patterns_layouts/tests/src/FunctionalJavascript/UiPatternsLayoutsRenderTest.php
UiPatternsPreviewRenderTest.php in tests/src/Functional/UiPatternsPreviewRenderTest.php
UiPatternsViewsRenderTest.php in modules/ui_patterns_views/tests/src/FunctionalJavascript/UiPatternsViewsRenderTest.php

File

tests/src/Traits/TwigDebugTrait.php, line 8

Namespace

Drupal\Tests\ui_patterns\Traits
View source
trait TwigDebugTrait {

  /**
   * Enable Twig debug mode.
   */
  public function enableTwigDebugMode() {

    // Enable debug, rebuild the service container, and clear all caches.
    $parameters = $this->container
      ->getParameter('twig.config');
    $parameters['debug'] = TRUE;
    $this
      ->setContainerParameter('twig.config', $parameters);
    $this
      ->rebuildContainer();
    $this
      ->resetAll();
  }

}

Members