22 new File(SABRE_TEMPDIR .
'/foobar.txt')
25 $server->debugExceptions =
true;
28 $tree[0]->put(
'1234567890');
51 'Content-Type' =>
'application/x-sabredav-partialupdate',
52 'X-Update-Range' => $headerValue,
59 $request =
new HTTP\Request(
'PATCH',
'/foobar.txt', $headers,
'----');
62 $this->server->httpRequest =
$request;
63 $this->server->httpResponse =
new HTTP\ResponseMock();
64 $this->server->sapi =
new HTTP\SapiMock();
65 $this->server->exec();
67 $this->assertEquals($httpStatus, $this->server->httpResponse->status,
'Incorrect http status received: ' . $this->server->httpResponse->body);
68 if (!is_null($endResult)) {
69 $this->assertEquals($endResult, file_get_contents(SABRE_TEMPDIR .
'/foobar.txt'));
79 [
'bytes=0-3', 411, null, 0],
80 [
'bytes=4-1', 416, null],
82 [
'bytes=0-3', 204,
'----567890'],
83 [
'bytes=1-4', 204,
'1----67890'],
84 [
'bytes=0-', 204,
'----567890'],
85 [
'bytes=-4', 204,
'123456----'],
86 [
'bytes=-2', 204,
'12345678----'],
87 [
'bytes=2-', 204,
'12----7890'],
88 [
'append', 204,
'1234567890----'],
foreach($paths as $path) $request
Partial update plugin (Patch method)
if(preg_match('#\.( $contentLength[^/\.]+)$#D', $path, $type)) if($contentType===null)
testUpdateRange($headerValue, $httpStatus, $endResult, $contentLength=4)
This test is an end-to-end sabredav test that goes through all the cases in the specification.
static clearTempDir()
This function deletes all the contents of the temporary directory.