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\Deserializer
;
4
5
use
Sabre\Xml\Service
;
6
7
class
RepeatingElementsTest
extends
\PHPUnit_Framework_TestCase
{
8
9
function
testRead
() {
10
11
$service =
new
Service
();
12
$service->elementMap[
'{urn:test}collection'
] =
function
(
$reader
) {
13
return
repeatingElements
(
$reader
,
'{urn:test}item'
);
14
};
15
16
$xml
= <<<XML
17
<?xml version=
"1.0"
?>
18
<collection xmlns=
"urn:test"
>
19
<item>foo</item>
20
<item>bar</item>
21
</collection>
22
XML;
23
24
$result
= $service->parse(
$xml
);
25
26
$expected = [
27
'foo'
,
28
'bar'
,
29
];
30
31
$this->assertEquals($expected,
$result
);
32
33
}
34
35
}
Sabre\Xml\Deserializer\RepeatingElementsTest\testRead
testRead()
Definition:
RepeatingElementsTest.php:9
$result
$result
Definition:
CleanUpTest.php:463
$reader
$reader
Definition:
scanCallStructure.php:5
Sabre\Xml\Deserializer\repeatingElements
repeatingElements(Reader $reader, $childElementName)
This deserializer helps you deserialize xml structures that look like this:
Definition:
functions.php:241
PHPUnit_Framework_TestCase
Sabre\Xml\Deserializer\RepeatingElementsTest
Definition:
RepeatingElementsTest.php:7
Sabre\Xml\Service
XML parsing and writing service.
Definition:
Service.php:16
Sabre\Xml\Deserializer
Definition:
functions.php:3
$xml
$xml
Definition:
fetch_windows_zones.php:11
php
Service
libs
composer
vendor
sabre
xml
tests
Sabre
Xml
Deserializer
RepeatingElementsTest.php
Generated on Thu Jan 16 2025 19:01:54 for ILIAS by
1.8.13 (using
Doxyfile
)