function FieldPluginBaseTest::setUp
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setUp()
- 10 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setUp()
- 9 core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setUp()
- 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldPluginBaseTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ field/ FieldPluginBaseTest.php, line 143
Class
Namespace
Drupal\Tests\views\Unit\Plugin\fieldCode
protected function setUp() : void {
parent::setUp();
$this->executable = $this->createStub(ViewExecutable::class);
$this->executable->style_plugin = $this->createStub(StylePluginBase::class);
$this->display = $this->createStub(DisplayPluginBase::class);
$this->urlGenerator = $this->createStub(UrlGeneratorInterface::class);
$this->pathValidator = $this->createStub(PathValidatorInterface::class);
$this->requestStack = new RequestStack();
$this->requestStack
->push(new Request());
$this->unroutedUrlAssembler = $this->createStub(UnroutedUrlAssemblerInterface::class);
$this->linkGenerator = $this->createStub(LinkGeneratorInterface::class);
$this->renderer = $this->createStub(RendererInterface::class);
$container_builder = new ContainerBuilder();
$container_builder->set('url_generator', $this->urlGenerator);
$container_builder->set('path.validator', $this->pathValidator);
$container_builder->set('unrouted_url_assembler', $this->unroutedUrlAssembler);
$container_builder->set('request_stack', $this->requestStack);
$container_builder->set('renderer', $this->renderer);
\Drupal::setContainer($container_builder);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.