function HandlerBaseTest::testGetEntityTypeForFieldOnBaseTable
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php \Drupal\Tests\views\Unit\Plugin\HandlerBaseTest::testGetEntityTypeForFieldOnBaseTable()
- 10 core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php \Drupal\Tests\views\Unit\Plugin\HandlerBaseTest::testGetEntityTypeForFieldOnBaseTable()
- 9 core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php \Drupal\Tests\views\Unit\Plugin\HandlerBaseTest::testGetEntityTypeForFieldOnBaseTable()
- 8.9.x core/modules/views/tests/src/Unit/Plugin/HandlerBaseTest.php \Drupal\Tests\views\Unit\Plugin\HandlerBaseTest::testGetEntityTypeForFieldOnBaseTable()
Tests get entity type for field on base table.
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ HandlerBaseTest.php, line 28
Class
Namespace
Drupal\Tests\views\Unit\PluginCode
public function testGetEntityTypeForFieldOnBaseTable() : void {
$view = $this->createMock(View::class);
$executable = $this->createStub(ViewExecutable::class);
$executable->storage = $view;
$viewsData = $this->createMock(ViewsData::class);
$handler = new TestHandler([], 'test_handler', []);
$handler->init($executable, $this->createStub(DisplayPluginBase::class));
$view->expects($this->once())
->method('get')
->with('base_table')
->willReturn('test_entity_type_table');
$viewsData->expects($this->once())
->method('get')
->with('test_entity_type_table')
->willReturn([
'table' => [
'entity type' => 'test_entity_type',
],
]);
$handler->setViewsData($viewsData);
$this->assertEquals('test_entity_type', $handler->getEntityType());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.