ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PropPatchTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\Xml\Request;
4 
7 
8 class PropPatchTest extends XmlTest {
9 
10  function testSerialize() {
11 
12  $propPatch = new PropPatch();
13  $propPatch->properties = [
14  '{DAV:}displayname' => 'Hello!',
15  '{DAV:}delete-me' => null,
16  '{DAV:}some-url' => new Href('foo/bar')
17  ];
18 
19  $result = $this->write(
20  ['{DAV:}propertyupdate' => $propPatch]
21  );
22 
23  $expected = <<<XML
24 <?xml version="1.0"?>
25 <d:propertyupdate xmlns:d="DAV:">
26  <d:set>
27  <d:prop>
28  <d:displayname>Hello!</d:displayname>
29  </d:prop>
30  </d:set>
31  <d:remove>
32  <d:prop>
33  <d:delete-me />
34  </d:prop>
35  </d:remove>
36  <d:set>
37  <d:prop>
38  <d:some-url>
39  <d:href>/foo/bar</d:href>
40  </d:some-url>
41  </d:prop>
42  </d:set>
43 </d:propertyupdate>
44 XML;
45 
46  $this->assertXmlStringEqualsXmlString(
47  $expected,
48  $result
49  );
50 
51  }
52 
53 }
$result
WebDAV PROPPATCH request parser.
Definition: PropPatch.php:20
Href property.
Definition: Href.php:26