comparison 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
comparison
equal deleted inserted replaced
6:cec75ba50afc 7:430dbd5346f7
1 <?php
2
3 namespace Sabre\VObject;
4
5 class ElementListTest extends \PHPUnit_Framework_TestCase {
6
7 function testIterate() {
8
9 $cal = new Component\VCalendar();
10 $sub = $cal->createComponent('VEVENT');
11
12 $elems = array(
13 $sub,
14 clone $sub,
15 clone $sub
16 );
17
18 $elemList = new ElementList($elems);
19
20 $count = 0;
21 foreach($elemList as $key=>$subcomponent) {
22
23 $count++;
24 $this->assertInstanceOf('Sabre\\VObject\\Component',$subcomponent);
25
26 }
27 $this->assertEquals(3,$count);
28 $this->assertEquals(2,$key);
29
30 }
31
32
33 }