From 0b02a6d123b2014705998c94ddf3d460948d3eac Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 10 May 2016 17:26:44 -0700 Subject: initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import) --- .../Sabre/DAV/PartialUpdate/SpecificationTest.php | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php') diff --git a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php index 7abe69c55..31be2a1b1 100644 --- a/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php +++ b/vendor/sabre/dav/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php @@ -42,21 +42,21 @@ class SpecificationTest extends \PHPUnit_Framework_TestCase { */ public function testUpdateRange($headerValue, $httpStatus, $endResult, $contentLength = 4) { - $vars = array( - 'REQUEST_METHOD' => 'PATCH', - 'HTTP_CONTENT_TYPE' => 'application/x-sabredav-partialupdate', - 'HTTP_X_UPDATE_RANGE' => $headerValue, - 'REQUEST_URI' => '/foobar.txt', - ); + $headers = [ + 'Content-Type' => 'application/x-sabredav-partialupdate', + 'X-Update-Range' => $headerValue, + ]; + if ($contentLength) { - $vars['HTTP_CONTENT_LENGTH'] = (string)$contentLength; + $headers['Content-Length'] = (string)$contentLength; } - $request = new HTTP\Request($vars); + $request = new HTTP\Request('PATCH', '/foobar.txt', $headers, '----'); $request->setBody('----'); $this->server->httpRequest = $request; $this->server->httpResponse = new HTTP\ResponseMock(); + $this->server->sapi = new HTTP\SapiMock(); $this->server->exec(); $this->assertEquals($httpStatus, $this->server->httpResponse->status, 'Incorrect http status received: ' . $this->server->httpResponse->body); @@ -70,17 +70,17 @@ class SpecificationTest extends \PHPUnit_Framework_TestCase { return array( // Problems - array('foo', 'HTTP/1.1 400 Bad request', null), - array('bytes=0-3', 'HTTP/1.1 411 Length Required', null, 0), - array('bytes=4-1', 'HTTP/1.1 416 Requested Range Not Satisfiable', null), - - array('bytes=0-3', 'HTTP/1.1 204 No Content', '----567890'), - array('bytes=1-4', 'HTTP/1.1 204 No Content', '1----67890'), - array('bytes=0-', 'HTTP/1.1 204 No Content', '----567890'), - array('bytes=-4', 'HTTP/1.1 204 No Content', '123456----'), - array('bytes=-2', 'HTTP/1.1 204 No Content', '12345678----'), - array('bytes=2-', 'HTTP/1.1 204 No Content', '12----7890'), - array('append', 'HTTP/1.1 204 No Content', '1234567890----'), + array('foo', 400, null), + array('bytes=0-3', 411, null, 0), + array('bytes=4-1', 416, null), + + array('bytes=0-3', 204, '----567890'), + array('bytes=1-4', 204, '1----67890'), + array('bytes=0-', 204, '----567890'), + array('bytes=-4', 204, '123456----'), + array('bytes=-2', 204, '12345678----'), + array('bytes=2-', 204, '12----7890'), + array('append', 204, '1234567890----'), ); -- cgit v1.2.3