You are here

protected function DateRecurBasicFormatterTest::renderFormatterSettings in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Kernel/DateRecurBasicFormatterTest.php \Drupal\Tests\date_recur\Kernel\DateRecurBasicFormatterTest::renderFormatterSettings()
  2. 3.0.x tests/src/Kernel/DateRecurBasicFormatterTest.php \Drupal\Tests\date_recur\Kernel\DateRecurBasicFormatterTest::renderFormatterSettings()
  3. 3.1.x tests/src/Kernel/DateRecurBasicFormatterTest.php \Drupal\Tests\date_recur\Kernel\DateRecurBasicFormatterTest::renderFormatterSettings()

Renders the date recur formatter and sets the HTML ready to be asserted.

Parameters

\Drupal\date_recur_entity_test\Entity\DrEntityTest $entity: A date recur test entity.

array $settings: Settings for date recur basic formatter.

4 calls to DateRecurBasicFormatterTest::renderFormatterSettings()
DateRecurBasicFormatterTest::testFormatterInterpretation in tests/src/Kernel/DateRecurBasicFormatterTest.php
Tests interpretation.
DateRecurBasicFormatterTest::testFormatterOccurrencesNotPerItem in tests/src/Kernel/DateRecurBasicFormatterTest.php
Tests occurrences.
DateRecurBasicFormatterTest::testFormatterOccurrencesPerItem in tests/src/Kernel/DateRecurBasicFormatterTest.php
Tests occurrences.
DateRecurBasicFormatterTest::testFormatterSameDay in tests/src/Kernel/DateRecurBasicFormatterTest.php
Tests formatter output for same start/end date.

File

tests/src/Kernel/DateRecurBasicFormatterTest.php, line 468

Class

DateRecurBasicFormatterTest
Tests date recur formatter.

Namespace

Drupal\Tests\date_recur\Kernel

Code

protected function renderFormatterSettings(DrEntityTest $entity, array $settings) {

  /** @var \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList $field */
  $field = $entity->dr;
  $build = $field
    ->view([
    'type' => 'date_recur_basic_formatter',
    'settings' => $settings,
  ]);

  /** @var \Drupal\Core\Render\RendererInterface $renderer */
  $renderer = $this->container
    ->get('renderer');
  $this
    ->setRawContent($renderer
    ->renderPlain($build));
}