function LinkBaseTest::setUp

Same name and namespace in other branches
  1. 10 core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php \Drupal\Tests\views\Unit\Plugin\views\field\LinkBaseTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/views/tests/src/Unit/Plugin/views/field/LinkBaseTest.php, line 32

Class

LinkBaseTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21field%21EntityLink.php/class/EntityLink/11.x" title="Field handler to present a link to an entity." class="local">\Drupal\views\Plugin\views\field\EntityLink</a> @group Views

Namespace

Drupal\Tests\views\Unit\Plugin\views\field

Code

protected function setUp() : void {
    parent::setUp();
    $this->setUpMockLoggerWithMissingEntity();
    $container = \Drupal::getContainer();
    $container->set('string_translation', $this->createMock(TranslationInterface::class));
    $container->set('renderer', $this->createMock(RendererInterface::class));
    \Drupal::setContainer($container);
}

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