You are here

public function DateRecurBasicFormatterTest::testFormatterInterpretation 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::testFormatterInterpretation()
  2. 3.0.x tests/src/Kernel/DateRecurBasicFormatterTest.php \Drupal\Tests\date_recur\Kernel\DateRecurBasicFormatterTest::testFormatterInterpretation()
  3. 3.1.x tests/src/Kernel/DateRecurBasicFormatterTest.php \Drupal\Tests\date_recur\Kernel\DateRecurBasicFormatterTest::testFormatterInterpretation()

Tests interpretation.

File

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

Class

DateRecurBasicFormatterTest
Tests date recur formatter.

Namespace

Drupal\Tests\date_recur\Kernel

Code

public function testFormatterInterpretation() {
  $dateFormatId = $this->dateFormat
    ->id();
  $settings = [
    'format_type' => $dateFormatId,
    'occurrence_format_type' => $dateFormatId,
    'same_end_date_format_type' => $dateFormatId,
    'interpreter' => $this->interpreter
      ->id(),
  ];
  $this
    ->renderFormatterSettings($this
    ->createRecurringEntity(), $settings);
  $interpretation = $this
    ->cssSelect('.date-recur-interpretaton');
  $this
    ->assertCount(1, $interpretation);
  $assertInnerText = (string) $interpretation[0];
  $this
    ->assertEquals('weekly on Monday, Tuesday, Wednesday, Thursday and Friday, starting from Mon, 16 Jun 2014 09:00:00 +1000, forever', $assertInnerText);
}