function FieldTest::testCalculateDependenciesWithConfiguredField
Same name in other branches
- 9 core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::testCalculateDependenciesWithConfiguredField()
- 8.9.x core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::testCalculateDependenciesWithConfiguredField()
- 11.x core/modules/views/tests/src/Unit/Plugin/field/FieldTest.php \Drupal\Tests\views\Unit\Plugin\field\FieldTest::testCalculateDependenciesWithConfiguredField()
@covers ::calculateDependencies
File
-
core/
modules/ views/ tests/ src/ Unit/ Plugin/ field/ FieldTest.php, line 247
Class
- FieldTest
- @coversDefaultClass \Drupal\views\Plugin\views\field\EntityField @group views
Namespace
Drupal\Tests\views\Unit\Plugin\fieldCode
public function testCalculateDependenciesWithConfiguredField() : void {
$definition = [
'entity_type' => 'test_entity',
'field_name' => 'body',
];
$handler = new EntityField([], 'field', $definition, $this->entityTypeManager, $this->formatterPluginManager, $this->fieldTypePluginManager, $this->languageManager, $this->renderer, $this->entityRepository, $this->entityFieldManager, $this->entityTypeBundleInfo);
$body_storage = $this->getConfigFieldStorage();
$this->entityFieldManager
->expects($this->atLeastOnce())
->method('getFieldStorageDefinitions')
->with('test_entity')
->willReturn([
'body' => $body_storage,
]);
$body_storage->expects($this->atLeastOnce())
->method('getConfigDependencyName')
->willReturn('field.field_storage_config.body');
$dependencies = $handler->calculateDependencies();
$this->assertEquals([
'config' => [
'field.field_storage_config.body',
],
], $dependencies);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.