ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
InfiteLoopTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\Xml;
4
6
11 function testDeserialize() {
12
13 $body = '<?xml version="1.0"?>
14<d:propertyupdate xmlns:d="DAV:" xmlns:s="http://sabredav.org/NS/test">
15 <d:set><d:prop></d:prop></d:set>
16 <d:set><d:prop></d:prop></d:set>
17</d:propertyupdate>';
18
19 $reader = new Reader();
20 $reader->elementMap = [
21 '{DAV:}set' => 'Sabre\\Xml\\Element\\KeyValue',
22 ];
23 $reader->xml($body);
24
25 $output = $reader->parse();
26
27 $this->assertEquals([
28 'name' => '{DAV:}propertyupdate',
29 'value' => [
30 [
31 'name' => '{DAV:}set',
32 'value' => [
33 '{DAV:}prop' => null,
34 ],
35 'attributes' => [],
36 ],
37 [
38 'name' => '{DAV:}set',
39 'value' => [
40 '{DAV:}prop' => null,
41 ],
42 'attributes' => [],
43 ],
44 ],
45 'attributes' => [],
46 ], $output);
47
48 }
49
50}
An exception for terminatinating execution or to throw for unit testing.
testDeserialize()
This particular xml body caused the parser to go into an infinite loop.
The Reader class expands upon PHP's built-in XMLReader.
Definition: Reader.php:20