function FieldPluginBaseTest::setUpMockUrlGenerator

Reinitializes the URL generator as a mock object.

1 call to FieldPluginBaseTest::setUpMockUrlGenerator()
FieldPluginBaseTest::testRenderAsLinkWithUrlAndOptions in core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php
Tests link rendering with a URL and options.

File

core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php, line 221

Class

FieldPluginBaseTest
Tests Drupal\views\Plugin\views\field\FieldPluginBase.

Namespace

Drupal\Tests\views\Unit\Plugin\field

Code

protected function setUpMockUrlGenerator() : void {
  $this->urlGenerator = $this->createMock(UrlGeneratorInterface::class);
  \Drupal::getContainer()->set('url_generator', $this->urlGenerator);
}

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