friendica-addons/dav/sabre-vobject/tests/Sabre/VObject/ElementListTest.php

33 lines
583 B
PHP
Raw Normal View History

2012-06-03 18:19:28 +00:00
<?php
namespace Sabre\VObject;
class ElementListTest extends \PHPUnit_Framework_TestCase {
2012-06-03 18:19:28 +00:00
function testIterate() {
$sub = new Component('VEVENT');
2012-06-03 18:19:28 +00:00
$elems = array(
$sub,
clone $sub,
clone $sub
);
$elemList = new ElementList($elems);
2012-06-03 18:19:28 +00:00
$count = 0;
foreach($elemList as $key=>$subcomponent) {
$count++;
$this->assertInstanceOf('Sabre\\VObject\\Component',$subcomponent);
2012-06-03 18:19:28 +00:00
}
$this->assertEquals(3,$count);
$this->assertEquals(2,$key);
}
}