12 'REQUEST_URI' =>
'/testcol',
13 'REQUEST_METHOD' =>
'MKCOL',
18 $this->server->httpRequest = (
$request);
19 $this->server->exec();
23 'Content-Length' => [
'0'],
24 ], $this->response->getHeaders());
26 $this->assertEquals(201, $this->response->status);
27 $this->assertEquals(
'', $this->response->body);
28 $this->assertTrue(is_dir($this->tempDir .
'/testcol'));
38 'REQUEST_URI' =>
'/testcol',
39 'REQUEST_METHOD' =>
'MKCOL',
44 $this->server->httpRequest = (
$request);
45 $this->server->exec();
49 'Content-Type' => [
'application/xml; charset=utf-8'],
50 ], $this->response->getHeaders());
52 $this->assertEquals(415, $this->response->status);
62 'REQUEST_URI' =>
'/testcol',
63 'REQUEST_METHOD' =>
'MKCOL',
64 'HTTP_CONTENT_TYPE' =>
'application/xml',
69 $this->server->httpRequest = (
$request);
70 $this->server->exec();
74 'Content-Type' => [
'application/xml; charset=utf-8'],
75 ], $this->response->getHeaders());
77 $this->assertEquals(400, $this->response->getStatus(), $this->response->getBodyAsString());
87 'REQUEST_URI' =>
'/testcol',
88 'REQUEST_METHOD' =>
'MKCOL',
89 'HTTP_CONTENT_TYPE' =>
'application/xml',
93 $request->setBody(
'<?xml version="1.0"?><html></html>');
94 $this->server->httpRequest = (
$request);
95 $this->server->exec();
99 'Content-Type' => [
'application/xml; charset=utf-8'],
100 ], $this->response->getHeaders());
102 $this->assertEquals(400, $this->response->getStatus());
112 'REQUEST_URI' =>
'/testcol',
113 'REQUEST_METHOD' =>
'MKCOL',
114 'HTTP_CONTENT_TYPE' =>
'application/xml',
118 $request->setBody(
'<?xml version="1.0"?> 122 <displayname>Evert</displayname> 126 $this->server->httpRequest = (
$request);
127 $this->server->exec();
129 $this->assertEquals([
131 'Content-Type' => [
'application/xml; charset=utf-8'],
132 ], $this->response->getHeaders());
134 $this->assertEquals(400, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
144 'REQUEST_URI' =>
'/testcol',
145 'REQUEST_METHOD' =>
'MKCOL',
146 'HTTP_CONTENT_TYPE' =>
'application/xml',
150 $request->setBody(
'<?xml version="1.0"?> 154 <resourcetype><collection /><blabla /></resourcetype> 158 $this->server->httpRequest = (
$request);
159 $this->server->exec();
161 $this->assertEquals([
163 'Content-Type' => [
'application/xml; charset=utf-8'],
164 ], $this->response->getHeaders());
166 $this->assertEquals(403, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
176 'REQUEST_URI' =>
'/testcol',
177 'REQUEST_METHOD' =>
'MKCOL',
178 'HTTP_CONTENT_TYPE' =>
'application/xml',
182 $request->setBody(
'<?xml version="1.0"?> 186 <resourcetype><collection /></resourcetype> 190 $this->server->httpRequest = (
$request);
191 $this->server->exec();
193 $this->assertEquals([
195 'Content-Length' => [
'0'],
196 ], $this->response->getHeaders());
198 $this->assertEquals(201, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
208 'REQUEST_URI' =>
'/testcol',
209 'REQUEST_METHOD' =>
'MKCOL',
210 'HTTP_CONTENT_TYPE' =>
'application/xml',
214 $request->setBody(
'<?xml version="1.0"?> 224 $this->server->httpRequest = (
$request);
225 $this->server->exec();
227 $this->assertEquals([
229 'Content-Length' => [
'0'],
230 ], $this->response->getHeaders());
232 $this->assertEquals(201, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
242 'REQUEST_URI' =>
'/testnoparent/409me',
243 'REQUEST_METHOD' =>
'MKCOL',
249 $this->server->httpRequest = (
$request);
250 $this->server->exec();
252 $this->assertEquals([
254 'Content-Type' => [
'application/xml; charset=utf-8'],
255 ], $this->response->getHeaders());
257 $this->assertEquals(409, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
267 'REQUEST_URI' =>
'/test.txt/409me',
268 'REQUEST_METHOD' =>
'MKCOL',
274 $this->server->httpRequest = (
$request);
275 $this->server->exec();
277 $this->assertEquals([
279 'Content-Type' => [
'application/xml; charset=utf-8'],
280 ], $this->response->getHeaders());
282 $this->assertEquals(409, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
292 'REQUEST_URI' =>
'/test.txt',
293 'REQUEST_METHOD' =>
'MKCOL',
299 $this->server->httpRequest = (
$request);
300 $this->server->exec();
302 $this->assertEquals([
304 'Content-Type' => [
'application/xml; charset=utf-8'],
305 'Allow' => [
'OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT'],
306 ], $this->response->getHeaders());
308 $this->assertEquals(405, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
321 [
'Content-Type' =>
'application/xml']
323 $request->setBody(
'<?xml version="1.0"?> 327 <resourcetype><collection /></resourcetype> 328 <displayname>my new collection</displayname> 332 $this->server->httpRequest = (
$request);
333 $this->server->exec();
335 $this->assertEquals(207, $this->response->status,
'Wrong statuscode received. Full response body: ' . $this->response->body);
337 $this->assertEquals([
339 'Content-Type' => [
'application/xml; charset=utf-8'],
340 ], $this->response->getHeaders());
342 $responseBody = $this->response->getBodyAsString();
345 <?xml version=
"1.0"?>
346 <d:multistatus xmlns:d=
"DAV:" xmlns:
s=
"http://sabredav.org/ns">
348 <d:href>/testcol</d:href>
353 <d:status>
HTTP/1.1 403 Forbidden</d:status>
359 $this->assertXmlStringEqualsXmlString(
testMKCOLSuccess()
testMKCOLIncorrectResourceType
testMKCOLUnknownXML()
testMkcol
testMKCOLParentIsNoCollection()
testMKCOLIncorrectResourceType
testMKCOLNoResourceType()
testMkcol
const VERSION
Full version number.
testMKCOLAlreadyExists()
testMKCOLIncorrectResourceType
testMKCOLAndProps()
testMKCOLSuccess testMKCOLAlreadyExists
testMKCOLIncorrectResourceType()
testMkcol
testMKCOLNoParent()
testMKCOLIncorrectResourceType
testMKCOLBrokenXML()
testMkcol
testMKCOLUnknownBody()
testMkcol
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
testMKCOLWhiteSpaceResourceType()
testMKCOLIncorrectResourceType