You are here

protected function RawStringFormatterTest::renderEntityFields in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php \Drupal\Tests\field\Kernel\String\RawStringFormatterTest::renderEntityFields()
  2. 10 core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php \Drupal\Tests\field\Kernel\String\RawStringFormatterTest::renderEntityFields()

Renders fields of a given entity with a given display.

Parameters

\Drupal\Core\Entity\FieldableEntityInterface $entity: The entity object with attached fields to render.

\Drupal\Core\Entity\Display\EntityViewDisplayInterface $display: The display to render the fields in.

Return value

string The rendered entity fields.

1 call to RawStringFormatterTest::renderEntityFields()
RawStringFormatterTest::testStringFormatter in core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php
Tests string formatter output.

File

core/modules/field/tests/src/Kernel/String/RawStringFormatterTest.php, line 101

Class

RawStringFormatterTest
Tests the raw string formatter.

Namespace

Drupal\Tests\field\Kernel\String

Code

protected function renderEntityFields(FieldableEntityInterface $entity, EntityViewDisplayInterface $display) {
  $content = $display
    ->build($entity);
  $content = $this
    ->render($content);
  return $content;
}