ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\Xml\Deserializer\RepeatingElementsTest Class Reference
+ Inheritance diagram for Sabre\Xml\Deserializer\RepeatingElementsTest:
+ Collaboration diagram for Sabre\Xml\Deserializer\RepeatingElementsTest:

Public Member Functions

 testRead ()
 

Detailed Description

Definition at line 7 of file RepeatingElementsTest.php.

Member Function Documentation

◆ testRead()

Sabre\Xml\Deserializer\RepeatingElementsTest::testRead ( )

Definition at line 9 of file RepeatingElementsTest.php.

References $reader, $result, $xml, and Sabre\Xml\Deserializer\repeatingElements().

9  {
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  }
$result
repeatingElements(Reader $reader, $childElementName)
This deserializer helps you deserialize xml structures that look like this:
Definition: functions.php:241
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: