ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ElementListTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\VObject;
4
5use PHPUnit\Framework\TestCase;
6
7class ElementListTest extends TestCase {
8
9 function testIterate() {
10
11 $cal = new Component\VCalendar();
12 $sub = $cal->createComponent('VEVENT');
13
14 $elems = [
15 $sub,
16 clone $sub,
17 clone $sub
18 ];
19
20 $elemList = new ElementList($elems);
21
22 $count = 0;
23 foreach ($elemList as $key => $subcomponent) {
24
25 $count++;
26 $this->assertInstanceOf('Sabre\\VObject\\Component', $subcomponent);
27
28 }
29 $this->assertEquals(3, $count);
30 $this->assertEquals(2, $key);
31
32 }
33
34
35}
An exception for terminatinating execution or to throw for unit testing.
VObject ElementList.
Definition: ElementList.php:18
$key
Definition: croninfo.php:18