function LinkGeneratorTest::setUpMockUrlGenerator

Reinitializes the URL generator as a mock object.

12 calls to LinkGeneratorTest::setUpMockUrlGenerator()
LinkGeneratorTest::testGenerate in core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
Tests the generate() method with a route.
LinkGeneratorTest::testGenerateActive in core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
Tests the active class on the link method.
LinkGeneratorTest::testGenerateAttributes in core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
Tests the link method with additional attributes.
LinkGeneratorTest::testGenerateButton in core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
Tests the generate() method with the <button> route.
LinkGeneratorTest::testGenerateHrefs in core/tests/Drupal/Tests/Core/Utility/LinkGeneratorTest.php
Tests the link method with certain hrefs.

... See full list

File

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

Class

LinkGeneratorTest
Tests Drupal\Core\Utility\LinkGenerator.

Namespace

Drupal\Tests\Core\Utility

Code

protected function setUpMockUrlGenerator() : void {
  $this->urlGenerator = $this->createMock(UrlGenerator::class);
  $reflection = new \ReflectionProperty($this->linkGenerator, 'urlGenerator');
  $reflection->setValue($this->linkGenerator, $this->urlGenerator);
}

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