friendica-addons/dav/SabreDAV/tests/Sabre/VObject/ElementListTest.php
2012-06-03 18:19:28 +00:00

30 lines
596 B
PHP

<?php
class Sabre_VObject_ElementListTest extends PHPUnit_Framework_TestCase {
function testIterate() {
$sub = new Sabre_VObject_Component('VEVENT');
$elems = array(
$sub,
clone $sub,
clone $sub
);
$elemList = new Sabre_VObject_ElementList($elems);
$count = 0;
foreach($elemList as $key=>$subcomponent) {
$count++;
$this->assertInstanceOf('Sabre_VObject_Component',$subcomponent);
}
$this->assertEquals(3,$count);
$this->assertEquals(2,$key);
}
}