You are here

public function TwigSanitizeTest::setUp in Twig Tools 8

Create a new TwigExtension object.

Overrides UnitTestCase::setUp

File

tests/src/Unit/TwigSanitizeTest.php, line 21

Class

TwigSanitizeTest
Tests to ensure sanitization filters work correctly.

Namespace

Drupal\Tests\twig_tools\Unit

Code

public function setUp() {
  parent::setUp();
  $loader = new StringLoader();
  $this->twig = new \Twig_Environment($loader);
  $twigTools = new TwigSanitize();
  $this->twig
    ->addExtension($twigTools);
}