ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\DAVACL\Exception\NotRecognizedPrincipalTest Class Reference
+ Inheritance diagram for Sabre\DAVACL\Exception\NotRecognizedPrincipalTest:
+ Collaboration diagram for Sabre\DAVACL\Exception\NotRecognizedPrincipalTest:

Public Member Functions

 testSerialize ()
 

Detailed Description

Definition at line 7 of file NotRecognizedPrincipalTest.php.

Member Function Documentation

◆ testSerialize()

Sabre\DAVACL\Exception\NotRecognizedPrincipalTest::testSerialize ( )

Definition at line 9 of file NotRecognizedPrincipalTest.php.

9 {
10
11 $ex = new NotRecognizedPrincipal('message');
12
13 $server = new DAV\Server();
14 $dom = new \DOMDocument('1.0', 'utf-8');
15 $root = $dom->createElementNS('DAV:', 'd:root');
16 $dom->appendChild($root);
17
18 $ex->serialize($server, $root);
19
20 $xpaths = [
21 '/d:root' => 1,
22 '/d:root/d:recognized-principal' => 1,
23 ];
24
25 // Reloading because PHP DOM sucks
26 $dom2 = new \DOMDocument('1.0', 'utf-8');
27 $dom2->loadXML($dom->saveXML());
28
29 $dxpath = new \DOMXPath($dom2);
30 $dxpath->registerNamespace('d', 'DAV:');
31 foreach ($xpaths as $xpath => $count) {
32
33 $this->assertEquals($count, $dxpath->query($xpath)->length, 'Looking for : ' . $xpath . ', we could only find ' . $dxpath->query($xpath)->length . ' elements, while we expected ' . $count);
34
35 }
36
37 }
$root
Definition: sabredav.php:45
$server
Definition: sabredav.php:48

References $root, and $server.


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