function LinkGeneratorTest::setUp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php \Drupal\Tests\Core\Utility\LinkGeneratorTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php \Drupal\Tests\Core\Utility\LinkGeneratorTest::setUp()
  3. 11.x core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php \Drupal\Tests\Core\Utility\LinkGeneratorTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php, line 74

Class

LinkGeneratorTest
@coversDefaultClass \Drupal\Core\Utility\LinkGenerator[[api-linebreak]] @group Utility

Namespace

Drupal\Tests\Core\Utility

Code

protected function setUp() : void {
  parent::setUp();
  $this->urlGenerator = $this->getMockBuilder('\\Drupal\\Core\\Routing\\UrlGenerator')
    ->disableOriginalConstructor()
    ->getMock();
  $this->moduleHandler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->renderer = $this->createMock('\\Drupal\\Core\\Render\\RendererInterface');
  $this->linkGenerator = new LinkGenerator($this->urlGenerator, $this->moduleHandler, $this->renderer);
  $this->urlAssembler = $this->createMock('\\Drupal\\Core\\Utility\\UnroutedUrlAssemblerInterface');
}

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