[Pkg-owncloud-commits] [php-sabre-vobject] 71/106: More RDATE tests.

David Prévot taffit at moszumanska.debian.org
Fri Aug 22 15:11:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 4bc1ed7e1d878553d4a645f9fed9a97ed4364258
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Thu Aug 7 01:42:28 2014 -0400

    More RDATE tests.
    
    Fixes #51.
---
 tests/VObject/Recur/EventIterator/MainTest.php | 47 ++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/tests/VObject/Recur/EventIterator/MainTest.php b/tests/VObject/Recur/EventIterator/MainTest.php
index b92261c..555abeb 100644
--- a/tests/VObject/Recur/EventIterator/MainTest.php
+++ b/tests/VObject/Recur/EventIterator/MainTest.php
@@ -1347,5 +1347,52 @@ class MainTest extends \PHPUnit_Framework_TestCase {
         $this->assertEquals(array(), $summaries);
 
     }
+
+    /**
+     * @depends testValues
+     */
+    function testRDATE() {
+
+        $vcal = new VCalendar();
+        $ev = $vcal->createComponent('VEVENT');
+
+        $ev->UID = 'bla';
+        $ev->RDATE = array(
+            new DateTime('2014-08-07', new DateTimeZone('UTC')),
+            new DateTime('2014-08-08', new DateTimeZone('UTC')),
+        );
+        $dtStart = $vcal->createProperty('DTSTART');
+        $dtStart->setDateTime(new DateTime('2011-10-07', new DateTimeZone('UTC')));
+
+        $ev->add($dtStart);
+
+        $vcal->add($ev);
+
+        $it = new EventIterator($vcal,$ev->uid);
+
+        // Max is to prevent overflow
+        $max = 12;
+        $result = array();
+        foreach($it as $item) {
+
+            $result[] = $item;
+            $max--;
+
+            if (!$max) break;
+
+        }
+
+        $tz = new DateTimeZone('UTC');
+
+        $this->assertEquals(
+            array(
+                new DateTime('2011-10-07', $tz),
+                new DateTime('2014-08-07', $tz),
+                new DateTime('2014-08-08', $tz),
+            ),
+            $result
+        );
+
+    }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git



More information about the Pkg-owncloud-commits mailing list