view vendor/sabre/vobject/tests/VObject/ElementListTest.php @ 41:d2414df68d78

Updated by Alex S Grebenschikov (www.poralix.com) to make it compatible with RoundCube 1.3.0
author Charlie Root
date Fri, 24 Jan 2025 14:20:15 -0500
parents 430dbd5346f7
children
line wrap: on
line source

<?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);

    }


}