function TwigExtensionTest::setUp

Same name in this branch
  1. 9 core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::setUp()
Same name in other branches
  1. 8.9.x core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::setUp()
  3. 10 core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::setUp()
  4. 10 core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php \Drupal\Tests\Core\Template\TwigExtensionTest::setUp()
  5. 11.x core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php \Drupal\Tests\system\Functional\Theme\TwigExtensionTest::setUp()
  6. 11.x 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

public 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.