16 <principal-match xmlns=
"DAV:">
21 $request =
new Request(
'REPORT',
'/principals', [
'Content-Type' =>
'application/xml']);
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>
33 <d:status>
HTTP/1.1 418
I'm a teapot</d:status> 38 $this->assertXmlStringEqualsXmlString( 40 $response->getBodyAsString() 45 function testPrincipalMatchProp() { 49 <principal-match xmlns="DAV:"> 57 $request = new Request('REPORT
', '/principals
', ['Content-Type
' => 'application/xml
']); 58 $request->setBody($xml); 60 $response = $this->request($request, 207); 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> 69 <d:resourcetype><d:principal/></d:resourcetype> 71 <d:status>HTTP/1.1 200 OK</d:status> 76 $this->assertXmlStringEqualsXmlString( 78 $response->getBodyAsString() 83 function testPrincipalMatchPrincipalProperty() { 87 <principal-match xmlns="DAV:"> 97 $request = new Request('REPORT
', '/principals
', ['Content-Type
' => 'application/xml
']); 98 $request->setBody($xml); 100 $response = $this->request($request, 207); 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> 109 <d:resourcetype><d:principal/></d:resourcetype> 111 <d:status>HTTP/1.1 200 OK</d:status> 116 $this->assertXmlStringEqualsXmlString( 118 $response->getBodyAsString() foreach($paths as $path) $request
The Request class represents a single HTTP request.
This class may be used as a basis for other webdav-related unittests.
request($request, $expectedStatus=null)
Makes a request, and returns a response object.