public function DateRecurRruleUnitTest::testGetExcluded in Recurring Dates Field 8.2
Same name and namespace in other branches
- 3.x tests/src/Unit/DateRecurRruleUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurRruleUnitTest::testGetExcluded()
- 3.0.x tests/src/Unit/DateRecurRruleUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurRruleUnitTest::testGetExcluded()
- 3.1.x tests/src/Unit/DateRecurRruleUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurRruleUnitTest::testGetExcluded()
Tests list.
@covers ::getExcluded
File
- tests/
src/ Unit/ DateRecurRruleUnitTest.php, line 139
Class
- DateRecurRruleUnitTest
- Date recur tests.
Namespace
Drupal\Tests\date_recur\UnitCode
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
->newRule($string, $dtStart);
$excluded = $helper
->getExcluded();
$this
->assertCount(1, $excluded);
$expectedDate = new \DateTime('9am 6 September 2018', $tz);
$this
->assertEquals($expectedDate, $excluded[0]);
}