protected function TextPlainUnitTest::renderEntityFields

Renders fields of a given entity with a given display.

Parameters

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

\Drupal\entity\Plugin\Core\Entity\EntityDisplay $display: The display to render the fields in.

1 call to TextPlainUnitTest::renderEntityFields()
TextPlainUnitTest::testPlainText in drupal/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php
Tests text_plain formatter output.

File

drupal/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php, line 123
Contains \Drupal\text\Tests\Formatter\TextPlainUnitTest.

Class

TextPlainUnitTest
Tests the text_plain field formatter.

Namespace

Drupal\text\Tests\Formatter

Code

protected function renderEntityFields(EntityInterface $entity, EntityDisplay $display) {
  $content = field_attach_view($entity, $display);
  $this->content = drupal_render($content);
  return $this->content;
}