protected function RadioactivityFunctionTestTrait::updateFieldEmitterSettings in Radioactivity 8.3
Same name and namespace in other branches
- 4.0.x tests/src/Traits/RadioactivityFunctionTestTrait.php \Drupal\Tests\radioactivity\Traits\RadioactivityFunctionTestTrait::updateFieldEmitterSettings()
Updates the emitter field display settings.
Parameters
string $fieldName: The field name.
array $settings: Allowed keys: 'energy': The energy value this field will emit when displayed. 'raw': True if the energy value is visible.
2 calls to RadioactivityFunctionTestTrait::updateFieldEmitterSettings()
- RadioactivityFunctionTestTrait::setFieldEmitterDisplay in tests/
src/ Traits/ RadioactivityFunctionTestTrait.php - Sets the emitter display mode of a field.
- RadioactivityFunctionTestTrait::setFieldEmitterEnergy in tests/
src/ Traits/ RadioactivityFunctionTestTrait.php - Sets the emitter energy of a field.
File
- tests/
src/ Traits/ RadioactivityFunctionTestTrait.php, line 262
Class
- RadioactivityFunctionTestTrait
- Radioactivity functional test trait.
Namespace
Drupal\Tests\radioactivity\TraitsCode
protected function updateFieldEmitterSettings($fieldName, array $settings) {
$display = EntityViewDisplay::load('entity_test.entity_test.default');
$component = $display
->getComponent($fieldName);
foreach ($settings as $key => $value) {
$component['settings'][$key] = $value;
}
$display
->setComponent($fieldName, $component)
->save();
}