function FieldTest::setUp
Same name in this branch
- 10 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FieldTest::setUp()
Same name in other branches
- 9 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::setUp()
- 9 core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FieldTest::setUp()
- 9 core/modules/quickedit/tests/src/FunctionalJavascript/FieldTest.php \Drupal\Tests\quickedit\FunctionalJavascript\FieldTest::setUp()
- 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::setUp()
- 8.9.x core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FieldTest::setUp()
- 8.9.x core/modules/quickedit/tests/src/FunctionalJavascript/FieldTest.php \Drupal\Tests\quickedit\FunctionalJavascript\FieldTest::setUp()
- 11.x core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::setUp()
- 11.x core/modules/views/tests/src/FunctionalJavascript/Plugin/views/Handler/FieldTest.php \Drupal\Tests\views\FunctionalJavascript\Plugin\views\Handler\FieldTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ field/ FieldTest.php, line 92
Class
- FieldTest
- @coversDefaultClass \Drupal\views\Plugin\views\field\EntityField @group views
Namespace
Drupal\Tests\views\Unit\Plugin\fieldCode
protected function setUp() : void {
parent::setUp();
$this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
$this->entityFieldManager = $this->createMock(EntityFieldManagerInterface::class);
$this->entityTypeBundleInfo = $this->createMock(EntityTypeBundleInfoInterface::class);
$this->entityRepository = $this->createMock(EntityRepositoryInterface::class);
$this->formatterPluginManager = $this->getMockBuilder('Drupal\\Core\\Field\\FormatterPluginManager')
->disableOriginalConstructor()
->getMock();
$this->fieldTypePluginManager = $this->createMock('Drupal\\Core\\Field\\FieldTypePluginManagerInterface');
$this->fieldTypePluginManager
->expects($this->any())
->method('getDefaultStorageSettings')
->willReturn([]);
$this->fieldTypePluginManager
->expects($this->any())
->method('getDefaultFieldSettings')
->willReturn([]);
$this->languageManager = $this->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
$this->renderer = $this->createMock('Drupal\\Core\\Render\\RendererInterface');
$this->setupExecutableAndView();
$this->setupViewsData();
$this->display = $this->getMockBuilder('Drupal\\views\\Plugin\\views\\display\\DisplayPluginBase')
->disableOriginalConstructor()
->getMock();
$this->container = new ContainerBuilder();
$this->container
->set('plugin.manager.field.field_type', $this->fieldTypePluginManager);
\Drupal::setContainer($this->container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.