function TwigExtensionTest::setUpMockFileUrlGenerator

Reinitializes the file URL generator as a mock object.

1 call to TwigExtensionTest::setUpMockFileUrlGenerator()
TwigExtensionTest::testFileUrl in core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php
Tests the file_url filter.

File

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

Class

TwigExtensionTest
Tests the twig extension.

Namespace

Drupal\Tests\Core\Template

Code

protected function setUpMockFileUrlGenerator() : void {
  $this->fileUrlGenerator = $this->createMock(FileUrlGeneratorInterface::class);
  $reflection = new \ReflectionProperty($this->systemUnderTest, 'fileUrlGenerator');
  $reflection->setValue($this->systemUnderTest, $this->fileUrlGenerator);
}

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