protected function BlazyCreationTestTrait::collectRenderDisplay in Blazy 8
Same name and namespace in other branches
- 8.2 tests/src/Traits/BlazyCreationTestTrait.php \Drupal\Tests\blazy\Traits\BlazyCreationTestTrait::collectRenderDisplay()
Sets field values as built by FieldItemListInterface::view().
Parameters
\Drupal\Core\Entity\EntityInterface[] $entity: An entity object that will be displayed.
array $settings: Settings specific to the formatter. Defaults to the formatter's defaults.
Return value
array A render array.
File
- tests/
src/ Traits/ BlazyCreationTestTrait.php, line 395
Class
- BlazyCreationTestTrait
- A Trait common for Blazy tests.
Namespace
Drupal\Tests\blazy\TraitsCode
protected function collectRenderDisplay(array $entity, array $settings = []) {
$view_mode = empty($settings['view_mode']) ? 'default' : $settings['view_mode'];
$display = EntityViewDisplay::collectRenderDisplay($entity, $view_mode);
return $display
->build($entity);
}