Renders a test_entity and sets the output in the internal browser.
int $id: The test_entity ID to render.
string $view_mode: (optional) The view mode to use for rendering.
bool $reset: (optional) Whether to reset the test_entity controller cache. Defaults to TRUE to simplify testing.
protected function renderTestEntity($id, $view_mode = 'full', $reset = TRUE) {
if ($reset) {
$this->container
->get('plugin.manager.entity')
->getStorageController('entity_test')
->resetCache(array(
$id,
));
}
$entity = entity_load('entity_test', $id);
$display = entity_get_display($entity
->entityType(), $entity
->bundle(), $view_mode);
field_attach_prepare_view('entity_test', array(
$entity
->id() => $entity,
), array(
$entity
->bundle() => $display,
));
$entity->content = field_attach_view($entity, $display);
$output = drupal_render($entity->content);
$this
->drupalSetContent($output);
$this
->verbose($output);
}