public function DateRecurRlInterpretationUnitTest::testWeekly in Recurring Dates Field 8.2
Same name and namespace in other branches
- 3.x tests/src/Unit/DateRecurRlInterpretationUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurRlInterpretationUnitTest::testWeekly()
- 3.0.x tests/src/Unit/DateRecurRlInterpretationUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurRlInterpretationUnitTest::testWeekly()
- 3.1.x tests/src/Unit/DateRecurRlInterpretationUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurRlInterpretationUnitTest::testWeekly()
Tests weekly interpretation.
File
- tests/
src/ Unit/ DateRecurRlInterpretationUnitTest.php, line 143
Class
- DateRecurRlInterpretationUnitTest
- Tests Rlanvin implementation of interpreter.
Namespace
Drupal\Tests\date_recur\UnitCode
public function testWeekly() {
$parts = [
'FREQ' => 'WEEKLY',
'DTSTART' => new \DateTime('4am 15 July 2012', new \DateTimeZone('Pacific/Honolulu')),
'BYDAY' => 'MO,TU',
];
$rules[] = new RlDateRecurRule($parts);
$configuration = [
'date_format' => $this
->randomMachineName(),
];
$interpreter = RlInterpreter::create($this->testContainer, $configuration, '', []);
$interpretation = $interpreter
->interpret($rules, 'en');
$this
->assertEquals('weekly on Monday and Tuesday, starting from Mon, 16 Jul 2012 00:00:00 +1000, forever', $interpretation);
}