[Pkg-owncloud-commits] [php-sabredav] 242/275: Updated tests to work with new sabre/http API.
David Prévot
taffit at moszumanska.debian.org
Thu Sep 25 14:56:15 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabredav.
commit 78df4817db890d6cb3d513097e2123fc26e63a7c
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Tue Sep 16 01:32:39 2014 +0100
Updated tests to work with new sabre/http API.
---
lib/CalDAV/Backend/BackendInterface.php | 3 +
lib/CalDAV/Backend/PDO.php | 3 +
lib/DAV/Server.php | 2 +-
tests/Sabre/CalDAV/FreeBusyReportTest.php | 2 +-
tests/Sabre/CalDAV/ICSExportPluginTest.php | 6 +-
tests/Sabre/CalDAV/PluginTest.php | 2 +-
.../Sabre/CalDAV/Schedule/FreeBusyRequestTest.php | 4 +-
tests/Sabre/CalDAV/ValidateICalTest.php | 2 +-
tests/Sabre/DAV/Browser/MapGetToPropFindTest.php | 2 +-
tests/Sabre/DAV/Browser/PluginTest.php | 6 +-
tests/Sabre/DAV/FSExt/ServerTest.php | 22 ++---
tests/Sabre/DAV/HttpPutTest.php | 6 +-
tests/Sabre/DAV/Locks/MSWordTest.php | 6 +-
tests/Sabre/DAV/Locks/PluginTest.php | 106 ++++++++++-----------
tests/Sabre/DAV/ServerCopyMoveTest.php | 14 +--
tests/Sabre/DAV/ServerMKCOLTest.php | 26 ++---
tests/Sabre/DAV/ServerPluginTest.php | 2 +-
tests/Sabre/DAV/ServerPreconditionTest.php | 2 +-
tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php | 2 +-
tests/Sabre/DAV/ServerPropsTest.php | 6 +-
tests/Sabre/DAV/ServerRangeTest.php | 14 +--
tests/Sabre/DAV/ServerSimpleTest.php | 24 ++---
tests/Sabre/DAV/TemporaryFileFilterTest.php | 26 ++---
tests/Sabre/DAVACL/ExpandPropertiesTest.php | 8 +-
tests/Sabre/DAVACL/PrincipalPropertySearchTest.php | 8 +-
.../DAVACL/PrincipalSearchPropertySetTest.php | 6 +-
tests/Sabre/HTTP/ResponseMock.php | 1 -
27 files changed, 158 insertions(+), 153 deletions(-)
diff --git a/lib/CalDAV/Backend/BackendInterface.php b/lib/CalDAV/Backend/BackendInterface.php
index d555bae..064972f 100644
--- a/lib/CalDAV/Backend/BackendInterface.php
+++ b/lib/CalDAV/Backend/BackendInterface.php
@@ -30,6 +30,9 @@ interface BackendInterface {
* For this property, you can just return an instance of
* Sabre\CalDAV\Property\SupportedCalendarComponentSet.
*
+ * If you return {http://sabredav.org/ns}read-only and set the value to 1,
+ * ACL will automatically be put in read-only mode.
+ *
* @param string $principalUri
* @return array
*/
diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php
index de8a51f..71e7fc3 100644
--- a/lib/CalDAV/Backend/PDO.php
+++ b/lib/CalDAV/Backend/PDO.php
@@ -143,6 +143,9 @@ class PDO extends AbstractBackend implements SyncSupport, SubscriptionSupport, S
* For this property, you can just return an instance of
* Sabre\CalDAV\Property\SupportedCalendarComponentSet.
*
+ * If you return {http://sabredav.org/ns}read-only and set the value to 1,
+ * ACL will automatically be put in read-only mode.
+ *
* @param string $principalUri
* @return array
*/
diff --git a/lib/DAV/Server.php b/lib/DAV/Server.php
index 7e02a1e..0036ad3 100644
--- a/lib/DAV/Server.php
+++ b/lib/DAV/Server.php
@@ -315,7 +315,7 @@ class Server extends EventEmitter {
$headers['Content-Type'] = 'application/xml; charset=utf-8';
$this->httpResponse->setStatus($httpCode);
- $this->httpResponse->addHeaders($headers);
+ $this->httpResponse->setHeaders($headers);
$this->httpResponse->setBody($DOM->saveXML());
$this->sapi->sendResponse($this->httpResponse);
diff --git a/tests/Sabre/CalDAV/FreeBusyReportTest.php b/tests/Sabre/CalDAV/FreeBusyReportTest.php
index 346f7fa..80b6027 100644
--- a/tests/Sabre/CalDAV/FreeBusyReportTest.php
+++ b/tests/Sabre/CalDAV/FreeBusyReportTest.php
@@ -93,7 +93,7 @@ XML;
$this->plugin->report('{urn:ietf:params:xml:ns:caldav}free-busy-query', $dom);
$this->assertEquals(200, $this->server->httpResponse->status);
- $this->assertEquals('text/calendar', $this->server->httpResponse->headers['Content-Type']);
+ $this->assertEquals('text/calendar', $this->server->httpResponse->getHeader('Content-Type'));
$this->assertTrue(strpos($this->server->httpResponse->body,'BEGIN:VFREEBUSY')!==false);
}
diff --git a/tests/Sabre/CalDAV/ICSExportPluginTest.php b/tests/Sabre/CalDAV/ICSExportPluginTest.php
index 5608157..fa0d9e3 100644
--- a/tests/Sabre/CalDAV/ICSExportPluginTest.php
+++ b/tests/Sabre/CalDAV/ICSExportPluginTest.php
@@ -61,7 +61,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(200, $s->httpResponse->status);
$this->assertEquals([
'Content-Type' => 'text/calendar',
- ], $s->httpResponse->headers);
+ ], $s->httpResponse->getHeaders());
$obj = VObject\Reader::read($s->httpResponse->body);
@@ -112,7 +112,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(200, $s->httpResponse->status);
$this->assertEquals([
'Content-Type' => 'text/calendar',
- ], $s->httpResponse->headers);
+ ], $s->httpResponse->getHeaders());
$obj = VObject\Reader::read($s->httpResponse->body);
@@ -219,7 +219,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'text/calendar',
- ), $s->httpResponse->headers);
+ ), $s->httpResponse->getHeaders());
$obj = VObject\Reader::read($s->httpResponse->body);
diff --git a/tests/Sabre/CalDAV/PluginTest.php b/tests/Sabre/CalDAV/PluginTest.php
index 4d1af54..c8f723e 100644
--- a/tests/Sabre/CalDAV/PluginTest.php
+++ b/tests/Sabre/CalDAV/PluginTest.php
@@ -1104,7 +1104,7 @@ END:VCALENDAR';
$this->assertEquals(array(
'Content-Type' => 'application/xml',
'ETag' => '"1"',
- ), $httpResponse->headers);
+ ), $httpResponse->getHeaders());
$expected =
'<?xml version="1.0" encoding="UTF-8"?>
diff --git a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
index 157329f..94dd934 100644
--- a/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
+++ b/tests/Sabre/CalDAV/Schedule/FreeBusyRequestTest.php
@@ -289,7 +289,7 @@ ICS;
$this->assertEquals(200, $this->response->status);
$this->assertEquals(array(
'Content-Type' => 'application/xml',
- ), $this->response->headers);
+ ), $this->response->getHeaders());
$strings = array(
'<d:href>mailto:user2.sabredav at sabredav.org</d:href>',
@@ -345,7 +345,7 @@ ICS;
$this->assertEquals(200, $this->response->status);
$this->assertEquals([
'Content-Type' => 'application/xml',
- ], $this->response->headers);
+ ], $this->response->getHeaders());
$strings = [
'<d:href>mailto:user2.sabredav at sabredav.org</d:href>',
diff --git a/tests/Sabre/CalDAV/ValidateICalTest.php b/tests/Sabre/CalDAV/ValidateICalTest.php
index 9591cbf..0d66404 100644
--- a/tests/Sabre/CalDAV/ValidateICalTest.php
+++ b/tests/Sabre/CalDAV/ValidateICalTest.php
@@ -92,7 +92,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => '0',
'ETag' => '"' . md5("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nUID:foo\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n") . '"',
- ), $response->headers);
+ ), $response->getHeaders());
$expected = array(
'uri' => 'blabla.ics',
diff --git a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
index c7e0768..c94f6fd 100644
--- a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
+++ b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
@@ -35,7 +35,7 @@ class MapGetToPropFindTest extends DAV\AbstractServer {
'DAV' => '1, 3, extended-mkcol',
'Vary' => 'Brief,Prefer',
),
- $this->response->headers
+ $this->response->getHeaders()
);
}
diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php
index 20ed0cd..f6192cd 100644
--- a/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/tests/Sabre/DAV/Browser/PluginTest.php
@@ -32,7 +32,7 @@ class PluginTest extends DAV\AbstractServer{
'Content-Type' => 'text/html; charset=utf-8',
'Content-Security-Policy' => "img-src 'self'; style-src 'self';"
],
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertTrue(strpos($this->response->body, '<title>dir/') !== false);
@@ -52,7 +52,7 @@ class PluginTest extends DAV\AbstractServer{
'Content-Type' => 'text/html; charset=utf-8',
'Content-Security-Policy' => "img-src 'self'; style-src 'self';"
],
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertTrue(strpos($this->response->body, '<title>/') !== false);
@@ -113,7 +113,7 @@ class PluginTest extends DAV\AbstractServer{
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Location' => '/',
- ), $this->response->headers);
+ ), $this->response->getHeaders());
$this->assertTrue(is_dir(SABRE_TEMPDIR . '/new_collection'));
diff --git a/tests/Sabre/DAV/FSExt/ServerTest.php b/tests/Sabre/DAV/FSExt/ServerTest.php
index d9fd970..26759b4 100644
--- a/tests/Sabre/DAV/FSExt/ServerTest.php
+++ b/tests/Sabre/DAV/FSExt/ServerTest.php
@@ -29,7 +29,7 @@ class ServerTest extends DAV\AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' .md5_file($this->tempDir . '/test.txt') . '"',
],
- $this->response->headers
+ $this->response->getHeaders()
);
@@ -50,7 +50,7 @@ class ServerTest extends DAV\AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5_file($this->tempDir . '/test.txt') . '"',
],
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200,$this->response->status);
@@ -69,7 +69,7 @@ class ServerTest extends DAV\AbstractServer{
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => 0,
'ETag' => '"' . md5('Testing new file') . '"',
- ], $this->response->headers);
+ ], $this->response->getHeaders());
$this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -87,7 +87,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ],$this->response->headers);
+ ],$this->response->getHeaders());
$this->assertEquals(412, $this->response->status);
$this->assertNotEquals('Testing new file',file_get_contents($this->tempDir . '/test.txt'));
@@ -103,7 +103,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => '0',
- ],$this->response->headers);
+ ],$this->response->getHeaders());
$this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -118,7 +118,7 @@ class ServerTest extends DAV\AbstractServer{
$this->server->httpRequest = ($request);
$this->server->exec();
- $this->assertEquals('0', $this->response->headers['Content-Length']);
+ $this->assertEquals('0', $this->response->getHeader('Content-Length'));
$this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -135,7 +135,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => '0',
- ],$this->response->headers);
+ ],$this->response->getHeaders());
$this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -155,7 +155,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => '0',
- ],$this->response->headers);
+ ],$this->response->getHeaders());
$this->assertEquals(204, $this->response->status);
$this->assertEquals('', $this->response->body);
$this->assertFalse(file_exists($this->tempDir . '/col'));
@@ -175,7 +175,7 @@ class ServerTest extends DAV\AbstractServer{
'Accept-Ranges' => 'bytes',
'Content-Length' => '0',
'X-Sabre-Version'=> DAV\Version::VERSION,
- ], $this->response->headers);
+ ], $this->response->getHeaders());
$this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -196,7 +196,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'Content-Length' => '0',
'X-Sabre-Version'=> DAV\Version::VERSION,
- ],$this->response->headers);
+ ],$this->response->getHeaders());
$this->assertTrue(
is_file($this->tempDir . '/testcol/test2.txt')
@@ -234,7 +234,7 @@ class ServerTest extends DAV\AbstractServer{
$this->assertEquals([
'Content-Length' => '0',
'X-Sabre-Version'=> DAV\Version::VERSION,
- ],$this->response->headers);
+ ],$this->response->getHeaders());
$this->assertTrue(
is_dir($this->tempDir . '/tree2/tree1')
diff --git a/tests/Sabre/DAV/HttpPutTest.php b/tests/Sabre/DAV/HttpPutTest.php
index 27fd7bc..a9befe1 100644
--- a/tests/Sabre/DAV/HttpPutTest.php
+++ b/tests/Sabre/DAV/HttpPutTest.php
@@ -49,7 +49,7 @@ class HttpPutTest extends DAVServerTest {
'Content-Length' => '0',
'ETag' => '"' . md5('hello') . '"'
],
- $response->headers
+ $response->getHeaders()
);
}
@@ -78,7 +78,7 @@ class HttpPutTest extends DAVServerTest {
'Content-Length' => '0',
'ETag' => '"' . md5('bar') . '"'
],
- $response->headers
+ $response->getHeaders()
);
}
@@ -112,7 +112,7 @@ class HttpPutTest extends DAVServerTest {
'Content-Length' => '0',
'ETag' => '"' . md5('hello') . '"'
],
- $response->headers
+ $response->getHeaders()
);
}
diff --git a/tests/Sabre/DAV/Locks/MSWordTest.php b/tests/Sabre/DAV/Locks/MSWordTest.php
index 1dd3420..e9eeacb 100644
--- a/tests/Sabre/DAV/Locks/MSWordTest.php
+++ b/tests/Sabre/DAV/Locks/MSWordTest.php
@@ -29,8 +29,8 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
$server->exec();
$this->assertEquals(201, $server->httpResponse->getStatus(), 'Full response body:' . $response1->getBodyAsString());
- $this->assertTrue(isset($server->httpResponse->headers['Lock-Token']));
- $lockToken = $server->httpResponse->headers['Lock-Token'];
+ $this->assertTrue(!!$server->httpResponse->getHeaders('Lock-Token'));
+ $lockToken = $server->httpResponse->getHeader('Lock-Token');
//sleep(10);
@@ -41,7 +41,7 @@ class MSWordTest extends \PHPUnit_Framework_TestCase {
$server->exec();
$this->assertEquals(201, $server->httpResponse->status);
- $this->assertTrue(isset($server->httpResponse->headers['Lock-Token']));
+ $this->assertTrue(!!$server->httpResponse->getHeaders('Lock-Token'));
//sleep(10);
diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php
index 46c888b..aa38af2 100644
--- a/tests/Sabre/DAV/Locks/PluginTest.php
+++ b/tests/Sabre/DAV/Locks/PluginTest.php
@@ -60,7 +60,7 @@ class PluginTest extends DAV\AbstractServer {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(400, $this->response->status);
@@ -87,8 +87,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status,'Got an incorrect status back. Response body: ' . $this->response->body);
@@ -122,7 +122,7 @@ class PluginTest extends DAV\AbstractServer {
$this->assertEquals('infinity',(string)$depth[0]);
$token = $xml->xpath('/d:prop/d:lockdiscovery/d:activelock/d:locktoken/d:href');
- $this->assertEquals($this->response->headers['Lock-Token'],'<' . (string)$token[0] . '>','Token in response body didn\'t match token in response header.');
+ $this->assertEquals($this->response->getHeader('Lock-Token'),'<' . (string)$token[0] . '>','Token in response body didn\'t match token in response header.');
}
@@ -154,7 +154,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
$this->assertEquals(423, $this->response->status, 'Full response: ' . $this->response->body);
@@ -218,8 +218,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(201, $this->response->status);
@@ -243,7 +243,7 @@ class PluginTest extends DAV\AbstractServer {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(400, $this->response->status);
@@ -269,7 +269,7 @@ class PluginTest extends DAV\AbstractServer {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(409, $this->response->status, 'Got an incorrect status code. Full response body: ' . $this->response->body);
@@ -299,8 +299,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
@@ -314,8 +314,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(423, $this->response->status);
@@ -342,7 +342,7 @@ class PluginTest extends DAV\AbstractServer {
</D:lockinfo>');
$this->server->invokeMethod($request, $this->server->httpResponse);
- $lockToken = $this->server->httpResponse->headers['Lock-Token'];
+ $lockToken = $this->server->httpResponse->getHeader('Lock-Token');
$serverVars = array(
'HTTP_LOCK_TOKEN' => $lockToken,
@@ -360,7 +360,7 @@ class PluginTest extends DAV\AbstractServer {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => '0',
),
- $this->server->httpResponse->headers
+ $this->server->httpResponse->getHeaders()
);
@@ -387,7 +387,7 @@ class PluginTest extends DAV\AbstractServer {
</D:lockinfo>');
$this->server->invokeMethod($request, $this->server->httpResponse);
- $lockToken = $this->server->httpResponse->headers['Lock-Token'];
+ $lockToken = $this->server->httpResponse->getHeader('Lock-Token');
// See Issue 123
$lockToken = trim($lockToken,'<>');
@@ -408,7 +408,7 @@ class PluginTest extends DAV\AbstractServer {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Length' => '0',
),
- $this->server->httpResponse->headers
+ $this->server->httpResponse->getHeaders()
);
@@ -433,7 +433,7 @@ class PluginTest extends DAV\AbstractServer {
</D:lockinfo>');
$this->server->invokeMethod($request, $this->server->httpResponse);
- $lockToken = $this->server->httpResponse->headers['Lock-Token'];
+ $lockToken = $this->server->httpResponse->getHeader('Lock-Token');
$locks = $this->locksPlugin->getLocks('test.txt');
$this->assertEquals(1,count($locks));
@@ -465,8 +465,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
@@ -481,8 +481,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
// $this->assertEquals('412 Precondition failed',$this->response->status);
$this->assertEquals(423, $this->response->status);
@@ -512,8 +512,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
@@ -527,7 +527,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(423, $this->response->status);
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
/**
@@ -553,15 +553,15 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/dir/child.txt',
'REQUEST_METHOD' => 'DELETE',
- 'HTTP_IF' => '(' . $this->response->headers['Lock-Token'] . ')',
+ 'HTTP_IF' => '(' . $this->response->getHeader('Lock-Token') . ')',
);
$request = HTTP\Sapi::createFromServerArray($serverVars);
@@ -569,7 +569,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(204, $this->response->status);
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
@@ -596,8 +596,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
@@ -612,7 +612,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(201, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
/**
@@ -638,8 +638,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(201, $this->response->status);
@@ -654,7 +654,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(423, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
@@ -681,8 +681,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
@@ -697,7 +697,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(423, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
@@ -724,8 +724,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
@@ -733,7 +733,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_URI' => '/dir/child.txt',
'REQUEST_METHOD' => 'MOVE',
'HTTP_DESTINATION' => '/dir/child2.txt',
- 'HTTP_IF' => '(' . $this->response->headers['Lock-Token'] . ')',
+ 'HTTP_IF' => '(' . $this->response->getHeader('Lock-Token') . ')',
);
$request = HTTP\Sapi::createFromServerArray($serverVars);
@@ -767,8 +767,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(201, $this->response->status);
@@ -783,7 +783,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(423, $this->response->status,'Copy must succeed if only the source is locked, but not the destination');
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
/**
@@ -810,8 +810,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200,$this->response->status);
@@ -819,7 +819,7 @@ class PluginTest extends DAV\AbstractServer {
'REQUEST_URI' => '/dir/child.txt',
'REQUEST_METHOD' => 'MOVE',
'HTTP_DESTINATION' => '/dir/child2.txt',
- 'HTTP_IF' => '</dir> (' . $this->response->headers['Lock-Token'] . ')',
+ 'HTTP_IF' => '</dir> (' . $this->response->getHeader('Lock-Token') . ')',
);
$request = HTTP\Sapi::createFromServerArray($serverVars);
@@ -827,7 +827,7 @@ class PluginTest extends DAV\AbstractServer {
$this->server->exec();
$this->assertEquals(201, $this->response->status,'We locked the parent of both the source and destination, but the move didn\'t succeed.');
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
}
@@ -854,15 +854,15 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(200, $this->response->status);
$serverVars = array(
'REQUEST_URI' => '/test.txt',
'REQUEST_METHOD' => 'PUT',
- 'HTTP_IF' => '('.$this->response->headers['Lock-Token'].')',
+ 'HTTP_IF' => '('.$this->response->getHeader('Lock-Token').')',
);
$request = HTTP\Sapi::createFromServerArray($serverVars);
@@ -870,8 +870,8 @@ class PluginTest extends DAV\AbstractServer {
$this->server->httpRequest = $request;
$this->server->exec();
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
$this->assertEquals(204, $this->response->status);
diff --git a/tests/Sabre/DAV/ServerCopyMoveTest.php b/tests/Sabre/DAV/ServerCopyMoveTest.php
index 8f7b33a..7e72857 100644
--- a/tests/Sabre/DAV/ServerCopyMoveTest.php
+++ b/tests/Sabre/DAV/ServerCopyMoveTest.php
@@ -66,7 +66,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals('Test contents', file_get_contents(SABRE_TEMPDIR. '/test2.txt'));
@@ -123,7 +123,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => 0,
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(204, $this->response->status);
@@ -149,7 +149,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(412, $this->response->status);
@@ -175,7 +175,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(409, $this->response->status);
@@ -217,7 +217,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR . '/col2/test.txt'));
@@ -240,7 +240,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(201, $this->response->status);
@@ -266,7 +266,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
),
- $this->response->headers
+ $this->response->getHeaders()
);
diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php
index 66776bc..8443e16 100644
--- a/tests/Sabre/DAV/ServerMKCOLTest.php
+++ b/tests/Sabre/DAV/ServerMKCOLTest.php
@@ -21,7 +21,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(201, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -47,7 +47,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(415, $this->response->status);
@@ -72,7 +72,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(400, $this->response->status);
@@ -97,7 +97,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(415, $this->response->status);
@@ -129,7 +129,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(400, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -161,7 +161,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -193,7 +193,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -225,7 +225,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -259,7 +259,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Length' => '0',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -284,7 +284,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -309,7 +309,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -335,7 +335,7 @@ class ServerMKCOLTest extends AbstractServer {
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
'Allow' => 'OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(405, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
@@ -371,7 +371,7 @@ class ServerMKCOLTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
}
diff --git a/tests/Sabre/DAV/ServerPluginTest.php b/tests/Sabre/DAV/ServerPluginTest.php
index f36cb93..c009c92 100644
--- a/tests/Sabre/DAV/ServerPluginTest.php
+++ b/tests/Sabre/DAV/ServerPluginTest.php
@@ -51,7 +51,7 @@ class ServerPluginTest extends AbstractServer {
'Accept-Ranges' => 'bytes',
'Content-Length' => '0',
'X-Sabre-Version' => Version::VERSION,
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
diff --git a/tests/Sabre/DAV/ServerPreconditionTest.php b/tests/Sabre/DAV/ServerPreconditionTest.php
index 7580f53..df27ef0 100644
--- a/tests/Sabre/DAV/ServerPreconditionTest.php
+++ b/tests/Sabre/DAV/ServerPreconditionTest.php
@@ -216,7 +216,7 @@ class ServerPreconditionsTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(304, $server->httpResponse->status);
$this->assertEquals(array(
'Last-Modified' => 'Sat, 06 Apr 1985 23:30:00 GMT',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
}
diff --git a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php
index bd20fd0..c7eaf16 100644
--- a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php
+++ b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php
@@ -59,7 +59,7 @@ class ServerPropsInfiniteDepthTest extends AbstractServer {
'DAV' => '1, 3, extended-mkcol, 2',
'Vary' => 'Brief,Prefer',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
diff --git a/tests/Sabre/DAV/ServerPropsTest.php b/tests/Sabre/DAV/ServerPropsTest.php
index 03bc7cf..97bf624 100644
--- a/tests/Sabre/DAV/ServerPropsTest.php
+++ b/tests/Sabre/DAV/ServerPropsTest.php
@@ -52,7 +52,7 @@ class ServerPropsTest extends AbstractServer {
'DAV' => '1, 3, extended-mkcol, 2',
'Vary' => 'Brief,Prefer',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
@@ -78,7 +78,7 @@ class ServerPropsTest extends AbstractServer {
'DAV' => '1, 3, extended-mkcol, 2',
'Vary' => 'Brief,Prefer',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
@@ -317,7 +317,7 @@ class ServerPropsTest extends AbstractServer {
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(207, $this->response->status,'We got the wrong status. Full XML response: ' . $this->response->body);
diff --git a/tests/Sabre/DAV/ServerRangeTest.php b/tests/Sabre/DAV/ServerRangeTest.php
index b592681..ca2f30c 100644
--- a/tests/Sabre/DAV/ServerRangeTest.php
+++ b/tests/Sabre/DAV/ServerRangeTest.php
@@ -33,7 +33,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')). '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(206, $this->response->status);
@@ -64,7 +64,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(206, $this->response->status);
@@ -95,7 +95,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')). '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(206, $this->response->status);
@@ -167,7 +167,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(206, $this->response->status);
@@ -200,7 +200,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
@@ -234,7 +234,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(206, $this->response->status);
@@ -267,7 +267,7 @@ class ServerRangeTest extends AbstractServer{
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
'ETag' => '"' . md5(file_get_contents(SABRE_TEMPDIR . '/test.txt')) . '"',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php
index cae5ca7..205087a 100644
--- a/tests/Sabre/DAV/ServerSimpleTest.php
+++ b/tests/Sabre/DAV/ServerSimpleTest.php
@@ -57,7 +57,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Length' => 13,
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
@@ -82,7 +82,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Length' => 13,
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
@@ -142,7 +142,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Length' => 13,
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
@@ -168,7 +168,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Length' => 13,
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
@@ -189,7 +189,7 @@ class ServerSimpleTest extends AbstractServer{
'Accept-Ranges' => 'bytes',
'Content-Length' => '0',
'X-Sabre-Version' => Version::VERSION,
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -210,7 +210,7 @@ class ServerSimpleTest extends AbstractServer{
'Accept-Ranges' => 'bytes',
'Content-Length' => '0',
'X-Sabre-Version' => Version::VERSION,
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(200, $this->response->status);
$this->assertEquals('', $this->response->body);
@@ -231,7 +231,7 @@ class ServerSimpleTest extends AbstractServer{
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(501, $this->response->status);
@@ -252,7 +252,7 @@ class ServerSimpleTest extends AbstractServer{
$this->assertEquals(array(
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(501, $this->response->status);
@@ -287,7 +287,7 @@ class ServerSimpleTest extends AbstractServer{
'Content-Length' => 13,
'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(200, $this->response->status);
@@ -544,7 +544,7 @@ class ServerSimpleTest extends AbstractServer{
$this->assertEquals(array(
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals(500, $this->response->status);
@@ -572,7 +572,7 @@ class ServerSimpleTest extends AbstractServer{
'X-Sabre-Version' => Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(415, $this->response->status, 'We got an incorrect status back. Full response body follows: ' . $this->response->body);
@@ -596,7 +596,7 @@ class ServerSimpleTest extends AbstractServer{
'X-Sabre-Version' => Version::VERSION,
'testheader' => 'testvalue',
),
- $this->response->headers
+ $this->response->getHeaders()
);
$this->assertEquals(418, $this->response->status,'We got an incorrect status back. Full response body follows: ' . $this->response->body);
diff --git a/tests/Sabre/DAV/TemporaryFileFilterTest.php b/tests/Sabre/DAV/TemporaryFileFilterTest.php
index cce9c24..bd71b4f 100644
--- a/tests/Sabre/DAV/TemporaryFileFilterTest.php
+++ b/tests/Sabre/DAV/TemporaryFileFilterTest.php
@@ -28,7 +28,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals('', $this->response->body);
$this->assertEquals(201, $this->response->status);
- $this->assertEquals('0', $this->response->headers['Content-Length']);
+ $this->assertEquals('0', $this->response->getHeader('Content-Length'));
$this->assertEquals('Testing new file',file_get_contents(SABRE_TEMPDIR . '/testput.txt'));
@@ -51,7 +51,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testput.txt'),'._testput.txt should not exist in the regular file structure.');
@@ -75,7 +75,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testput.txt'),'._testput.txt should not exist in the regular file structure.');
@@ -86,7 +86,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
}
@@ -107,7 +107,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$serverVars = array(
'REQUEST_URI' => '/._testput.txt',
@@ -123,7 +123,7 @@ class TemporaryFileFilterTest extends AbstractServer {
'X-Sabre-Temp' => 'true',
'Content-Length' => 16,
'Content-Type' => 'application/octet-stream',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals('Testing new file',stream_get_contents($this->response->body));
@@ -157,9 +157,9 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->server->exec();
$this->assertEquals(201, $this->response->status);
- $this->assertEquals('application/xml; charset=utf-8',$this->response->headers['Content-Type']);
- $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->headers['Lock-Token'])===1,'We did not get a valid Locktoken back (' . $this->response->headers['Lock-Token'] . ')');
- $this->assertEquals('true',$this->response->headers['X-Sabre-Temp']);
+ $this->assertEquals('application/xml; charset=utf-8',$this->response->getHeader('Content-Type'));
+ $this->assertTrue(preg_match('/^<opaquelocktoken:(.*)>$/',$this->response->getHeader('Lock-Token'))===1,'We did not get a valid Locktoken back (' . $this->response->getHeader('Lock-Token') . ')');
+ $this->assertEquals('true',$this->response->getHeader('X-Sabre-Temp'));
$this->assertFalse(file_exists(SABRE_TEMPDIR . '/._testlock.txt'),'._testlock.txt should not exist in the regular file structure.');
@@ -182,7 +182,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$serverVars = array(
'REQUEST_URI' => '/._testput.txt',
@@ -196,7 +196,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(204, $this->response->status, "Incorrect status code received. Full body:\n". $this->response->body);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$this->assertEquals('',$this->response->body);
@@ -219,7 +219,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(201, $this->response->status);
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$serverVars = array(
'REQUEST_URI' => '/._testput.txt',
@@ -235,7 +235,7 @@ class TemporaryFileFilterTest extends AbstractServer {
$this->assertEquals(array(
'X-Sabre-Temp' => 'true',
'Content-Type' => 'application/xml; charset=utf-8',
- ),$this->response->headers);
+ ),$this->response->getHeaders());
$body = preg_replace("/xmlns(:[A-Za-z0-9_])?=(\"|\')DAV:(\"|\')/","xmlns\\1=\"urn:DAV\"",$this->response->body);
$xml = simplexml_load_string($body);
diff --git a/tests/Sabre/DAVACL/ExpandPropertiesTest.php b/tests/Sabre/DAVACL/ExpandPropertiesTest.php
index 0961439..b0b9263 100644
--- a/tests/Sabre/DAVACL/ExpandPropertiesTest.php
+++ b/tests/Sabre/DAVACL/ExpandPropertiesTest.php
@@ -71,7 +71,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
@@ -134,7 +134,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
@@ -199,7 +199,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
@@ -267,7 +267,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
diff --git a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
index 6140833..39311ef 100644
--- a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
+++ b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
@@ -66,7 +66,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
}
@@ -106,7 +106,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
}
@@ -146,7 +146,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
@@ -211,7 +211,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
'Vary' => 'Brief,Prefer',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
diff --git a/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php b/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
index ec8baeb..3640ba7 100644
--- a/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
+++ b/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
@@ -52,7 +52,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
}
@@ -79,7 +79,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
}
@@ -106,7 +106,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(
'X-Sabre-Version' => DAV\Version::VERSION,
'Content-Type' => 'application/xml; charset=utf-8',
- ), $server->httpResponse->headers);
+ ), $server->httpResponse->getHeaders());
$check = array(
diff --git a/tests/Sabre/HTTP/ResponseMock.php b/tests/Sabre/HTTP/ResponseMock.php
index 135196b..7ef4a3f 100644
--- a/tests/Sabre/HTTP/ResponseMock.php
+++ b/tests/Sabre/HTTP/ResponseMock.php
@@ -18,6 +18,5 @@ class ResponseMock extends Response {
*/
public $body;
public $status;
- public $headers = [];
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git
More information about the Pkg-owncloud-commits
mailing list