Add transformer DTEND test

This commit is contained in:
simshaun 2014-04-01 22:33:52 -04:00
parent 62a547c9f0
commit 335240a213

View File

@ -36,6 +36,22 @@ class RuleTransformerTest extends RuleTransformerBase
$this->assertEquals(new \DateTime('2016-03-16 04:00:00'), $computed[2]);
}
public function testDtend()
{
$rule = new Rule(
'FREQ=YEARLY;DTEND=20160316T040000',
new \DateTime('2014-03-16 04:00:00')
);
$this->transformer->setRule($rule);
$computed = $this->transformer->getComputedArray();
$this->assertCount(3, $computed);
$this->assertEquals(new \DateTime('2014-03-16 04:00:00'), $computed[0]);
$this->assertEquals(new \DateTime('2015-03-16 04:00:00'), $computed[1]);
$this->assertEquals(new \DateTime('2016-03-16 04:00:00'), $computed[2]);
}
public function testRfc2445Example()
{
$rule = new Rule(