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

Public Member Functions

 testPrincipalMatch ()
 
 testPrincipalMatchProp ()
 
 testPrincipalMatchPrincipalProperty ()
 
- Public Member Functions inherited from Sabre\DAVServerTest
 setUp ()
 
 initializeEverything ()
 
 request ($request, $expectedStatus=null)
 Makes a request, and returns a response object. More...
 
 autoLogin ($userName)
 This function takes a username and sets the server in a state where this user is logged in, and no longer requires an authentication check. More...
 
 setUpTree ()
 Override this to provide your own Tree for your test-case. More...
 
 setUpBackends ()
 
 assertHttpStatus ($expectedStatus, HTTP\Request $req)
 

Data Fields

 $setupACL = true
 
 $autoLogin = 'user1'
 

Additional Inherited Members

- Protected Attributes inherited from Sabre\DAVServerTest
 $setupCalDAV = false
 
 $setupCardDAV = false
 
 $setupACL = false
 
 $setupCalDAVSharing = false
 
 $setupCalDAVScheduling = false
 
 $setupCalDAVSubscriptions = false
 
 $setupCalDAVICSExport = false
 
 $setupLocks = false
 
 $setupFiles = false
 
 $setupSharing = false
 
 $setupPropertyStorage = false
 
 $caldavCalendars = []
 An array with calendars. More...
 
 $caldavCalendarObjects = []
 
 $carddavAddressBooks = []
 
 $carddavCards = []
 
 $server
 
 $tree = []
 
 $caldavBackend
 
 $carddavBackend
 
 $principalBackend
 
 $locksBackend
 
 $propertyStorageBackend
 
 $caldavPlugin
 
 $carddavPlugin
 
 $aclPlugin
 
 $caldavSharingPlugin
 
 $caldavSchedulePlugin
 
 $authPlugin
 
 $locksPlugin
 
 $sharingPlugin
 
 $propertyStoragePlugin
 
 $autoLogin = null
 If this string is set, we will automatically log in the user with this name. More...
 

Detailed Description

Definition at line 7 of file PrincipalMatchTest.php.

Member Function Documentation

◆ testPrincipalMatch()

Sabre\DAVACL\PrincipalMatchTest::testPrincipalMatch ( )

Definition at line 12 of file PrincipalMatchTest.php.

References $request, $response, $xml, and Sabre\DAVServerTest\request().

12  {
13 
14  $xml = <<<XML
15 <?xml version="1.0"?>
16 <principal-match xmlns="DAV:">
17  <self />
18 </principal-match>
19 XML;
20 
21  $request = new Request('REPORT', '/principals', ['Content-Type' => 'application/xml']);
22  $request->setBody($xml);
23 
24  $response = $this->request($request, 207);
25 
26  $expected = <<<XML
27 <?xml version="1.0"?>
28 <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
29  <d:status>HTTP/1.1 200 OK</d:status>
30  <d:href>/principals/user1</d:href>
31  <d:propstat>
32  <d:prop/>
33  <d:status>HTTP/1.1 418 I'm a teapot</d:status>
34  </d:propstat>
35 </d:multistatus>
36 XML;
37 
38  $this->assertXmlStringEqualsXmlString(
39  $expected,
40  $response->getBodyAsString()
41  );
42 
43  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response
+ Here is the call graph for this function:

◆ testPrincipalMatchPrincipalProperty()

Sabre\DAVACL\PrincipalMatchTest::testPrincipalMatchPrincipalProperty ( )

Definition at line 83 of file PrincipalMatchTest.php.

83  {
84 
85  $xml = <<<XML
86 <?xml version="1.0"?>
87 <principal-match xmlns="DAV:">
88  <principal-property>
89  <principal-URL />
90  </principal-property>
91  <prop>
92  <resourcetype />
93  </prop>
94 </principal-match>
95 XML;
96 
97  $request = new Request('REPORT', '/principals', ['Content-Type' => 'application/xml']);
98  $request->setBody($xml);
99 
100  $response = $this->request($request, 207);
101 
102  $expected = <<<XML
103 <?xml version="1.0"?>
104 <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
105  <d:status>HTTP/1.1 200 OK</d:status>
106  <d:href>/principals/user1/</d:href>
107  <d:propstat>
108  <d:prop>
109  <d:resourcetype><d:principal/></d:resourcetype>
110  </d:prop>
111  <d:status>HTTP/1.1 200 OK</d:status>
112  </d:propstat>
113 </d:multistatus>
114 XML;
115 
116  $this->assertXmlStringEqualsXmlString(
117  $expected,
118  $response->getBodyAsString()
119  );
120 
121  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response

◆ testPrincipalMatchProp()

Sabre\DAVACL\PrincipalMatchTest::testPrincipalMatchProp ( )

Definition at line 45 of file PrincipalMatchTest.php.

45  {
46 
47  $xml = <<<XML
48 <?xml version="1.0"?>
49 <principal-match xmlns="DAV:">
50  <self />
51  <prop>
52  <resourcetype />
53  </prop>
54 </principal-match>
55 XML;
56 
57  $request = new Request('REPORT', '/principals', ['Content-Type' => 'application/xml']);
58  $request->setBody($xml);
59 
60  $response = $this->request($request, 207);
61 
62  $expected = <<<XML
63 <?xml version="1.0"?>
64 <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
65  <d:status>HTTP/1.1 200 OK</d:status>
66  <d:href>/principals/user1/</d:href>
67  <d:propstat>
68  <d:prop>
69  <d:resourcetype><d:principal/></d:resourcetype>
70  </d:prop>
71  <d:status>HTTP/1.1 200 OK</d:status>
72  </d:propstat>
73 </d:multistatus>
74 XML;
75 
76  $this->assertXmlStringEqualsXmlString(
77  $expected,
78  $response->getBodyAsString()
79  );
80 
81  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
request($request, $expectedStatus=null)
Makes a request, and returns a response object.
$response

Field Documentation

◆ $autoLogin

Sabre\DAVACL\PrincipalMatchTest::$autoLogin = 'user1'

Definition at line 10 of file PrincipalMatchTest.php.

◆ $setupACL

Sabre\DAVACL\PrincipalMatchTest::$setupACL = true

Definition at line 9 of file PrincipalMatchTest.php.


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