mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 00:03:46 +00:00
31 lines
596 B
PHP
31 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);
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|