You are here

protected function LinkGeneratorTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 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 71

Class

LinkGeneratorTest
@coversDefaultClass \Drupal\Core\Utility\LinkGenerator @group Utility

Namespace

Drupal\Tests\Core\Utility

Code

protected function setUp() {
  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');
}