ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
EnumTest.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
EnumTest
extends
\PHPUnit_Framework_TestCase
{
8
9
function
testDeserialize
() {
10
11
$service =
new
Service
();
12
$service->elementMap[
'{urn:test}root'
] =
'Sabre\Xml\Deserializer\enum'
;
13
14
$xml
= <<<XML
15
<?xml version=
"1.0"
?>
16
<root xmlns=
"urn:test"
>
17
<foo1/>
18
<foo2/>
19
</root>
20
XML;
21
22
$result
= $service->parse(
$xml
);
23
24
$expected = [
25
'{urn:test}foo1'
,
26
'{urn:test}foo2'
,
27
];
28
29
30
$this->assertEquals($expected,
$result
);
31
32
33
}
34
35
function
testDeserializeDefaultNamespace
() {
36
37
$service =
new
Service
();
38
$service->elementMap[
'{urn:test}root'
] =
function
(
$reader
) {
39
return
enum
(
$reader
,
'urn:test'
);
40
};
41
42
$xml
= <<<XML
43
<?xml version=
"1.0"
?>
44
<root xmlns=
"urn:test"
>
45
<foo1/>
46
<foo2/>
47
</root>
48
XML;
49
50
$result
= $service->parse(
$xml
);
51
52
$expected = [
53
'foo1'
,
54
'foo2'
,
55
];
56
57
58
$this->assertEquals($expected,
$result
);
59
60
}
61
62
}
$result
$result
Definition:
CleanUpTest.php:463
$reader
$reader
Definition:
scanCallStructure.php:5
Sabre\Xml\Deserializer\EnumTest
Definition:
EnumTest.php:7
PHPUnit_Framework_TestCase
Sabre\Xml\Deserializer\EnumTest\testDeserialize
testDeserialize()
Definition:
EnumTest.php:9
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
Sabre\Xml\Deserializer\EnumTest\testDeserializeDefaultNamespace
testDeserializeDefaultNamespace()
Definition:
EnumTest.php:35
Service
libs
composer
vendor
sabre
xml
tests
Sabre
Xml
Deserializer
EnumTest.php
Generated on Thu Jan 16 2025 19:01:54 for ILIAS by
1.8.13 (using
Doxyfile
)