From 335240a213e812458b9fba1e5e6819d7c0814115 Mon Sep 17 00:00:00 2001 From: simshaun Date: Tue, 1 Apr 2014 22:33:52 -0400 Subject: [PATCH] Add transformer DTEND test --- tests/Recurr/Test/RuleTransformerTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/Recurr/Test/RuleTransformerTest.php b/tests/Recurr/Test/RuleTransformerTest.php index 42519d8..f7a6082 100644 --- a/tests/Recurr/Test/RuleTransformerTest.php +++ b/tests/Recurr/Test/RuleTransformerTest.php @@ -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(