diff vendor/sabre/vobject/tests/VObject/ElementListTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/sabre/vobject/tests/VObject/ElementListTest.php	Sat Jan 13 09:06:10 2018 -0500
@@ -0,0 +1,33 @@
+<?php
+
+namespace Sabre\VObject;
+
+class ElementListTest extends \PHPUnit_Framework_TestCase {
+
+    function testIterate() {
+
+        $cal = new Component\VCalendar();
+        $sub = $cal->createComponent('VEVENT');
+
+        $elems = array(
+            $sub,
+            clone $sub,
+            clone $sub
+        );
+
+        $elemList = new ElementList($elems);
+
+        $count = 0;
+        foreach($elemList as $key=>$subcomponent) {
+
+           $count++;
+           $this->assertInstanceOf('Sabre\\VObject\\Component',$subcomponent);
+
+        }
+        $this->assertEquals(3,$count);
+        $this->assertEquals(2,$key);
+
+    }
+
+
+}