aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/vobject/tests/Sabre/VObject/ElementListTest.php
blob: 84e1bcbe908f23330310c756cd99ce07c292623b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace Sabre\VObject;

class ElementListTest extends \PHPUnit_Framework_TestCase {

    function testIterate() {

        $sub = new Component('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);

    }


}