You are here

protected function FormatterTestBase::renderEntityFields in Address 8

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.

6 calls to FormatterTestBase::renderEntityFields()
AddressDefaultFormatterTest::testAndorraAddress in tests/src/Kernel/Formatter/AddressDefaultFormatterTest.php
Tests Andorra address formatting.
AddressDefaultFormatterTest::testElSalvadorAddress in tests/src/Kernel/Formatter/AddressDefaultFormatterTest.php
Tests El Salvador address formatting.
AddressDefaultFormatterTest::testTaiwanAddress in tests/src/Kernel/Formatter/AddressDefaultFormatterTest.php
Tests Taiwan address formatting.
AddressDefaultFormatterTest::testUnitedStatesIncompleteAddress in tests/src/Kernel/Formatter/AddressDefaultFormatterTest.php
Tests US address formatting.
AddressPlainFormatterTest::testRender in tests/src/Kernel/Formatter/AddressPlainFormatterTest.php
Tests the rendered output.

... See full list

File

tests/src/Kernel/Formatter/FormatterTestBase.php, line 103

Class

FormatterTestBase
Provides a base test for kernel formatter tests.

Namespace

Drupal\Tests\address\Kernel\Formatter

Code

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