1<?php
2
3namespace Sabre\Xml\Serializer;
4
5use Sabre\Xml\Service;
6
7class EnumTest extends \PHPUnit_Framework_TestCase {
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}
37