ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PrincipalMatchReportTest.php
Go to the documentation of this file.
1<?php
2
4
6
7 protected $elementMap = [
8
9 '{DAV:}principal-match' => 'Sabre\DAVACL\Xml\Request\PrincipalMatchReport',
10
11 ];
12
13 function testDeserialize() {
14
15 $xml = <<<XML
16<?xml version="1.0" encoding="utf-8" ?>
17 <D:principal-match xmlns:D="DAV:">
18 <D:principal-property>
19 <D:owner/>
20 </D:principal-property>
21 </D:principal-match>
22XML;
23
24 $result = $this->parse($xml);
25
26 $this->assertEquals(PrincipalMatchReport::PRINCIPAL_PROPERTY, $result['value']->type);
27 $this->assertEquals('{DAV:}owner', $result['value']->principalProperty);
28
29 }
30
32
33 $xml = <<<XML
34<?xml version="1.0" encoding="utf-8" ?>
35 <D:principal-match xmlns:D="DAV:">
36 <D:self />
37 <D:prop>
38 <D:foo />
39 </D:prop>
40 </D:principal-match>
41XML;
42
43 $result = $this->parse($xml);
44
45 $this->assertEquals(PrincipalMatchReport::SELF, $result['value']->type);
46 $this->assertNull($result['value']->principalProperty);
47 $this->assertEquals(['{DAV:}foo'], $result['value']->properties);
48
49 }
50
51}
$result
An exception for terminatinating execution or to throw for unit testing.
const SELF
Report on a list of principals that match the current principal.
const PRINCIPAL_PROPERTY
Report on a property on resources, such as {DAV:}owner, that match the current principal.
parse($xml, array $elementMap=[])
Definition: XmlTest.php:26