You are here

protected function TwigExtensionTest::setUp in Drupal 10

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::setUp()
  2. 10 core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::setUp()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::setUp()
  2. 9 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php, line 74

Class

TwigExtensionTest
Tests the twig extension.

Namespace

Drupal\Tests\Core\Template

Code

protected function setUp() : void {
  parent::setUp();
  $this->renderer = $this
    ->createMock('\\Drupal\\Core\\Render\\RendererInterface');
  $this->urlGenerator = $this
    ->createMock('\\Drupal\\Core\\Routing\\UrlGeneratorInterface');
  $this->themeManager = $this
    ->createMock('\\Drupal\\Core\\Theme\\ThemeManagerInterface');
  $this->dateFormatter = $this
    ->createMock('\\Drupal\\Core\\Datetime\\DateFormatterInterface');
  $this->fileUrlGenerator = $this
    ->createMock(FileUrlGeneratorInterface::class);
  $this->systemUnderTest = new TwigExtension($this->renderer, $this->urlGenerator, $this->themeManager, $this->dateFormatter, $this->fileUrlGenerator);
}