ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
EnumTest.php
Go to the documentation of this file.
1<?php
2
4
6
8
9 function testSerialize() {
10
11 $service = new Service();
12 $service->namespaceMap['urn:test'] = null;
13
14 $xml = $service->write('{urn:test}root', function($writer) {
15 enum($writer, [
16 '{urn:test}foo1',
17 '{urn:test}foo2',
18 ]);
19 });
20
21 $expected = <<<XML
22<?xml version="1.0"?>
23<root xmlns="urn:test">
24 <foo1/>
25 <foo2/>
26</root>
27XML;
28
29
30 $this->assertXmlStringEqualsXmlString($expected, $xml);
31
32
33 }
34
35
36}
An exception for terminatinating execution or to throw for unit testing.
XML parsing and writing service.
Definition: Service.php:16