Definition at line 7 of file RepeatingElementsTest.php.
◆ testSerialize()
Sabre\Xml\Serializer\RepeatingElementsTest::testSerialize |
( |
| ) |
|
Definition at line 9 of file RepeatingElementsTest.php.
9 {
10
11 $service = new Service();
12 $service->namespaceMap['urn:test'] = null;
13 $xml = $service->write(
'{urn:test}collection',
function($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>
26XML;
27
28
29 $this->assertXmlStringEqualsXmlString($expected,
$xml);
30
31
32 }
repeatingElements(Writer $writer, array $items, $childElementName)
This serializer helps you serialize xml structures that look like this:
References $xml, and Sabre\Xml\Serializer\repeatingElements().
The documentation for this class was generated from the following file: