ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
RepeatingElementsTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\Xml\Serializer
;
4
5
use
Sabre\Xml\Service
;
6
7
class
RepeatingElementsTest
extends
\PHPUnit_Framework_TestCase
{
8
9
function
testSerialize
() {
10
11
$service =
new
Service
();
12
$service->namespaceMap[
'urn:test'
] = null;
13
$xml
= $service->write(
'{urn:test}collection'
,
function
($writer) {
14
repeatingElements
($writer, [
15
'foo'
,
16
'bar'
,
17
],
'{urn:test}item'
);
18
});
19
20
$expected = <<<XML
21
<?xml version=
"1.0"
?>
22
<collection xmlns=
"urn:test"
>
23
<item>foo</item>
24
<item>bar</item>
25
</collection>
26
XML;
27
28
29
$this->assertXmlStringEqualsXmlString($expected,
$xml
);
30
31
32
}
33
34
35
}
Sabre\Xml\Serializer\repeatingElements
repeatingElements(Writer $writer, array $items, $childElementName)
This serializer helps you serialize xml structures that look like this:
Definition:
functions.php:97
PHPUnit_Framework_TestCase
Sabre\Xml\Serializer\RepeatingElementsTest\testSerialize
testSerialize()
Definition:
RepeatingElementsTest.php:9
Sabre\Xml\Service
XML parsing and writing service.
Definition:
Service.php:16
Sabre\Xml\Serializer\RepeatingElementsTest
Definition:
RepeatingElementsTest.php:7
$xml
$xml
Definition:
fetch_windows_zones.php:11
php
Sabre\Xml\Serializer
Definition:
functions.php:3
Service
libs
composer
vendor
sabre
xml
tests
Sabre
Xml
Serializer
RepeatingElementsTest.php
Generated on Thu Jan 30 2025 19:01:30 for ILIAS by
1.8.13 (using
Doxyfile
)