You are here

public function DateRecurRlHelperUnitTest::testGetExcluded in Recurring Dates Field 8.2

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

Tests list.

@covers ::getExcluded

File

tests/src/Unit/DateRecurRlHelperUnitTest.php, line 285

Class

DateRecurRlHelperUnitTest
Tests Rlanvin implementation of helper.

Namespace

Drupal\Tests\date_recur\Unit

Code

public function testGetExcluded() {
  $tz = new \DateTimeZone('Asia/Singapore');
  $dtStart = new \DateTime('9am 4 September 2018', $tz);
  $string = 'RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR;COUNT=3
EXDATE:20180906T010000Z';
  $helper = $this
    ->createHelper($string, $dtStart);
  $excluded = $helper
    ->getExcluded();
  $this
    ->assertCount(1, $excluded);
  $expectedDate = new \DateTime('9am 6 September 2018', $tz);
  $this
    ->assertEquals($expectedDate, $excluded[0]);
}