[Pkg-owncloud-commits] [php-sabredav] 192/275: added version header

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:56:07 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 dd1b2ceb261c76699517448690f3ba1dcdf16a1f
Author: Dominik Tobschall <dominik at fruux.com>
Date:   Tue Aug 26 07:42:16 2014 +0200

    added version header
---
 lib/DAV/CorePlugin.php                             |  3 --
 lib/DAV/Server.php                                 | 13 +++++----
 tests/Sabre/CalDAV/ICSExportPluginTest.php         |  1 +
 tests/Sabre/CalDAV/ValidateICalTest.php            |  1 +
 tests/Sabre/DAV/Browser/MapGetToPropFindTest.php   |  1 +
 tests/Sabre/DAV/Browser/PluginTest.php             |  4 +++
 tests/Sabre/DAV/FSExt/ServerTest.php               |  7 +++++
 tests/Sabre/DAV/HttpDeleteTest.php                 |  2 ++
 tests/Sabre/DAV/HttpPutTest.php                    | 10 ++++++-
 tests/Sabre/DAV/Locks/PluginTest.php               |  7 ++++-
 tests/Sabre/DAV/ServerCopyMoveTest.php             | 32 ++++++++++++---------
 tests/Sabre/DAV/ServerMKCOLTest.php                | 33 ++++++++++++++--------
 tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php   |  1 +
 tests/Sabre/DAV/ServerPropsTest.php                |  4 ++-
 tests/Sabre/DAV/ServerRangeTest.php                |  7 +++++
 tests/Sabre/DAV/ServerSimpleTest.php               | 11 +++++++-
 tests/Sabre/DAVACL/ExpandPropertiesTest.php        |  4 +++
 tests/Sabre/DAVACL/PrincipalPropertySearchTest.php |  4 +++
 .../DAVACL/PrincipalSearchPropertySetTest.php      |  3 ++
 19 files changed, 112 insertions(+), 36 deletions(-)

diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php
index da5ef7e..7fb9e34 100644
--- a/lib/DAV/CorePlugin.php
+++ b/lib/DAV/CorePlugin.php
@@ -220,9 +220,6 @@ class CorePlugin extends ServerPlugin {
         $response->setHeader('DAV', implode(', ', $features));
         $response->setHeader('MS-Author-Via', 'DAV');
         $response->setHeader('Accept-Ranges', 'bytes');
-        if (Server::$exposeVersion) {
-            $response->setHeader('X-Sabre-Version', Version::VERSION);
-        }
         $response->setHeader('Content-Length', '0');
         $response->setStatus(200);
 
diff --git a/lib/DAV/Server.php b/lib/DAV/Server.php
index c443005..b097485 100644
--- a/lib/DAV/Server.php
+++ b/lib/DAV/Server.php
@@ -443,8 +443,12 @@ class Server extends EventEmitter {
 
         $method = $request->getMethod();
 
-        if (!$this->emit('beforeMethod:' . $method,[$request, $response])) return;
-        if (!$this->emit('beforeMethod',[$request, $response])) return;
+        if (!$this->emit('beforeMethod:' . $method, [$request, $response])) return;
+        if (!$this->emit('beforeMethod', [$request, $response])) return;
+
+        if (Server::$exposeVersion) {
+            $response->setHeader('X-Sabre-Version', Version::VERSION);
+        }
 
         $this->transactionType = strtolower($method);
 
@@ -453,13 +457,13 @@ class Server extends EventEmitter {
         }
 
         if ($this->emit('method:' . $method, [$request, $response])) {
-            if ($this->emit('method',[$request, $response])) {
+            if ($this->emit('method', [$request, $response])) {
                 // Unsupported method
                 throw new Exception\NotImplemented('There was no handler found for this "' . $method . '" method');
             }
         }
 
-        if (!$this->emit('afterMethod:' . $method,[$request, $response])) return;
+        if (!$this->emit('afterMethod:' . $method, [$request, $response])) return;
         if (!$this->emit('afterMethod', [$request, $response])) return;
 
         $this->sapi->sendResponse($response);
@@ -1727,4 +1731,3 @@ class Server extends EventEmitter {
     // }}}
 
 }
-
diff --git a/tests/Sabre/CalDAV/ICSExportPluginTest.php b/tests/Sabre/CalDAV/ICSExportPluginTest.php
index c0e25e2..5608157 100644
--- a/tests/Sabre/CalDAV/ICSExportPluginTest.php
+++ b/tests/Sabre/CalDAV/ICSExportPluginTest.php
@@ -217,6 +217,7 @@ class ICSExportPluginTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(200, $s->httpResponse->status,'Invalid status received. Response body: '. $s->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'text/calendar',
         ), $s->httpResponse->headers);
 
diff --git a/tests/Sabre/CalDAV/ValidateICalTest.php b/tests/Sabre/CalDAV/ValidateICalTest.php
index 1aee90e..9591cbf 100644
--- a/tests/Sabre/CalDAV/ValidateICalTest.php
+++ b/tests/Sabre/CalDAV/ValidateICalTest.php
@@ -89,6 +89,7 @@ class ValidateICalTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(201, $response->status, 'Incorrect status returned! Full response body: ' . $response->body);
         $this->assertEquals(array(
+            '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);
diff --git a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
index 9c615a6..c7e0768 100644
--- a/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
+++ b/tests/Sabre/DAV/Browser/MapGetToPropFindTest.php
@@ -30,6 +30,7 @@ class MapGetToPropFindTest extends DAV\AbstractServer {
 
         $this->assertEquals(207, $this->response->status,'Incorrect status response received. Full response body: ' . $this->response->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             'DAV' => '1, 3, extended-mkcol',
             'Vary' => 'Brief,Prefer',
diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php
index ccdd49d..a169cec 100644
--- a/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/tests/Sabre/DAV/Browser/PluginTest.php
@@ -31,6 +31,7 @@ class PluginTest extends DAV\AbstractServer{
 
         $this->assertEquals(200, $this->response->status, "Incorrect status received. Full response body: " . $this->response->getBodyAsString());
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'text/html; charset=utf-8',
             'Content-Security-Policy' => "img-src 'self'; style-src 'self';"
             ),
@@ -54,6 +55,7 @@ class PluginTest extends DAV\AbstractServer{
 
         $this->assertEquals(200, $this->response->status, "Incorrect status received. Full response body: " . $this->response->getBodyAsString());
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'text/html; charset=utf-8',
             'Content-Security-Policy' => "img-src 'self'; style-src 'self';"
             ),
@@ -127,6 +129,7 @@ class PluginTest extends DAV\AbstractServer{
 
         $this->assertEquals(302, $this->response->status);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Location' => '/',
         ), $this->response->headers);
 
@@ -142,6 +145,7 @@ class PluginTest extends DAV\AbstractServer{
 
         $this->assertEquals(200, $this->response->getStatus(), 'Error: ' . $this->response->body);
         $this->assertEquals([
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'image/vnd.microsoft.icon',
             'Content-Length' => '4286',
             'Cache-Control' => 'public, max-age=1209600',
diff --git a/tests/Sabre/DAV/FSExt/ServerTest.php b/tests/Sabre/DAV/FSExt/ServerTest.php
index 89dd1ef..c581238 100644
--- a/tests/Sabre/DAV/FSExt/ServerTest.php
+++ b/tests/Sabre/DAV/FSExt/ServerTest.php
@@ -23,6 +23,7 @@ class ServerTest extends DAV\AbstractServer{
 
         $this->assertEquals(200, $this->response->getStatus(), 'Invalid status code received.');
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -48,6 +49,7 @@ class ServerTest extends DAV\AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -74,6 +76,7 @@ class ServerTest extends DAV\AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Length' => 0,
             'ETag'           => '"' . md5('Testing new file') . '"',
         ), $this->response->headers);
@@ -98,6 +101,7 @@ class ServerTest extends DAV\AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
@@ -119,6 +123,7 @@ class ServerTest extends DAV\AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Length' => '0',
         ),$this->response->headers);
 
@@ -160,6 +165,7 @@ class ServerTest extends DAV\AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Length' => '0',
         ),$this->response->headers);
 
@@ -184,6 +190,7 @@ class ServerTest extends DAV\AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Length' => '0',
         ),$this->response->headers);
         $this->assertEquals(204, $this->response->status);
diff --git a/tests/Sabre/DAV/HttpDeleteTest.php b/tests/Sabre/DAV/HttpDeleteTest.php
index b17f501..9a53831 100644
--- a/tests/Sabre/DAV/HttpDeleteTest.php
+++ b/tests/Sabre/DAV/HttpDeleteTest.php
@@ -48,6 +48,7 @@ class HttpDeleteTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
             ],
             $response->getHeaders()
@@ -72,6 +73,7 @@ class HttpDeleteTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
             ],
             $response->getHeaders()
diff --git a/tests/Sabre/DAV/HttpPutTest.php b/tests/Sabre/DAV/HttpPutTest.php
index cf15b23..27fd7bc 100644
--- a/tests/Sabre/DAV/HttpPutTest.php
+++ b/tests/Sabre/DAV/HttpPutTest.php
@@ -45,6 +45,7 @@ class HttpPutTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
                 'ETag' => '"' . md5('hello') . '"'
             ],
@@ -73,6 +74,7 @@ class HttpPutTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
                 'ETag' => '"' . md5('bar') . '"'
             ],
@@ -106,6 +108,7 @@ class HttpPutTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
                 'ETag' => '"' . md5('hello') . '"'
             ],
@@ -139,6 +142,7 @@ class HttpPutTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
                 'ETag' => '"' . md5('hello') . '"'
             ],
@@ -191,6 +195,7 @@ class HttpPutTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
                 'ETag' => '"' . md5('hello') . '"'
             ],
@@ -285,6 +290,7 @@ class HttpPutTest extends DAVServerTest {
 
         $this->assertEquals(
             [
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
                 'ETag' => '"' . md5('hello') . '"'
             ],
@@ -334,7 +340,9 @@ class HttpPutTest extends DAVServerTest {
             $this->server->tree->nodeExists('file2')
         );
 
-        $this->assertEquals([], $response->getHeaders());
+        $this->assertEquals([
+            'X-Sabre-Version' => Version::VERSION,
+        ], $response->getHeaders());
 
     }
 
diff --git a/tests/Sabre/DAV/Locks/PluginTest.php b/tests/Sabre/DAV/Locks/PluginTest.php
index ccb897c..d05ddf5 100644
--- a/tests/Sabre/DAV/Locks/PluginTest.php
+++ b/tests/Sabre/DAV/Locks/PluginTest.php
@@ -57,6 +57,7 @@ class PluginTest extends DAV\AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             ),
             $this->response->headers
@@ -239,6 +240,7 @@ class PluginTest extends DAV\AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             ),
             $this->response->headers
@@ -264,12 +266,13 @@ class PluginTest extends DAV\AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             ),
             $this->response->headers
          );
 
-        $this->assertEquals(409, $this->response->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
+        $this->assertEquals(409, $this->response->status, 'Got an incorrect status code. Full response body: ' . $this->response->body);
 
     }
 
@@ -354,6 +357,7 @@ class PluginTest extends DAV\AbstractServer {
 
         $this->assertEquals(204,$this->server->httpResponse->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Length' => '0',
             ),
             $this->server->httpResponse->headers
@@ -401,6 +405,7 @@ class PluginTest extends DAV\AbstractServer {
 
         $this->assertEquals(204, $this->server->httpResponse->status,'Got an incorrect status code. Full response body: ' . $this->response->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Length' => '0',
             ),
             $this->server->httpResponse->headers
diff --git a/tests/Sabre/DAV/ServerCopyMoveTest.php b/tests/Sabre/DAV/ServerCopyMoveTest.php
index 3e5c0db..4bd9a2a 100644
--- a/tests/Sabre/DAV/ServerCopyMoveTest.php
+++ b/tests/Sabre/DAV/ServerCopyMoveTest.php
@@ -61,14 +61,15 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->httpRequest = ($request);
         $this->server->exec();
 
-        $this->assertEquals(204, $this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
+        $this->assertEquals(204, $this->response->status, 'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
             ),
             $this->response->headers
          );
 
-        $this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR. '/test2.txt'));
+        $this->assertEquals('Test contents', file_get_contents(SABRE_TEMPDIR. '/test2.txt'));
 
     }
 
@@ -84,8 +85,8 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->httpRequest = ($request);
         $this->server->exec();
 
-        $this->assertEquals(403, $this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
-        $this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR. '/test.txt'));
+        $this->assertEquals(403, $this->response->status, 'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
+        $this->assertEquals('Test contents', file_get_contents(SABRE_TEMPDIR. '/test.txt'));
 
     }
 
@@ -101,8 +102,8 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->httpRequest = ($request);
         $this->server->exec();
 
-        $this->assertEquals(403, $this->response->status,'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
-        $this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR. '/test.txt'));
+        $this->assertEquals(403, $this->response->status, 'Received an incorrect HTTP status. Full body inspection: ' . $this->response->body);
+        $this->assertEquals('Test contents', file_get_contents(SABRE_TEMPDIR. '/test.txt'));
 
     }
 
@@ -119,14 +120,15 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->exec();
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => 0,
             ),
             $this->response->headers
          );
 
         $this->assertEquals(204, $this->response->status);
-        $this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR . '/test2.txt'));
-        $this->assertFalse(file_exists(SABRE_TEMPDIR . '/test.txt'),'The sourcefile test.txt should no longer exist at this point');
+        $this->assertEquals('Test contents', file_get_contents(SABRE_TEMPDIR . '/test2.txt'));
+        $this->assertFalse(file_exists(SABRE_TEMPDIR . '/test.txt'), 'The sourcefile test.txt should no longer exist at this point');
 
     }
 
@@ -144,13 +146,14 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->exec();
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Type' => 'application/xml; charset=utf-8',
             ),
             $this->response->headers
          );
 
         $this->assertEquals(412, $this->response->status);
-        $this->assertEquals('Test contents2',file_get_contents(SABRE_TEMPDIR . '/test2.txt'));
+        $this->assertEquals('Test contents2', file_get_contents(SABRE_TEMPDIR . '/test2.txt'));
 
 
     }
@@ -169,6 +172,7 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->exec();
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Type' => 'application/xml; charset=utf-8',
             ),
             $this->response->headers
@@ -207,15 +211,15 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->httpRequest = ($request);
         $this->server->exec();
 
-        $this->assertEquals(201, $this->response->status,'Full response: ' . $this->response->getBody(true));
+        $this->assertEquals(201, $this->response->status, 'Full response: ' . $this->response->getBody(true));
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Length' => '0',
             ),
             $this->response->headers
          );
 
-
         $this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR . '/col2/test.txt'));
 
     }
@@ -233,13 +237,14 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Length' => '0',
             ),
             $this->response->headers
          );
 
         $this->assertEquals(201, $this->response->status);
-        $this->assertEquals('Test contents',file_get_contents(SABRE_TEMPDIR . '/test3.txt'));
+        $this->assertEquals('Test contents', file_get_contents(SABRE_TEMPDIR . '/test3.txt'));
 
     }
 
@@ -255,9 +260,10 @@ class ServerCopyMoveTest extends \PHPUnit_Framework_TestCase {
         $this->server->httpRequest = ($request);
         $this->server->exec();
 
-        $this->assertEquals(201, $this->response->status,'Incorrect status received. Full response body: ' . $this->response->body);
+        $this->assertEquals(201, $this->response->status, 'Incorrect status received. Full response body: ' . $this->response->body);
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Length' => '0',
             ),
             $this->response->headers
diff --git a/tests/Sabre/DAV/ServerMKCOLTest.php b/tests/Sabre/DAV/ServerMKCOLTest.php
index 3eea687..66776bc 100644
--- a/tests/Sabre/DAV/ServerMKCOLTest.php
+++ b/tests/Sabre/DAV/ServerMKCOLTest.php
@@ -19,6 +19,7 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Length' => '0',
         ),$this->response->headers);
 
@@ -44,6 +45,7 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
@@ -68,6 +70,7 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
@@ -92,6 +95,7 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
@@ -123,10 +127,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
-        $this->assertEquals(400, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(400, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -154,10 +159,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
-        $this->assertEquals(403, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -185,10 +191,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
-        $this->assertEquals(403, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(403, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -216,10 +223,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Length' => '0',
         ),$this->response->headers);
 
-        $this->assertEquals(201, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -249,10 +257,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Length' => '0',
         ),$this->response->headers);
 
-        $this->assertEquals(201, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(201, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -273,10 +282,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
-        $this->assertEquals(409, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -297,10 +307,11 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
-        $this->assertEquals(409, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(409, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -321,11 +332,12 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+            '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->assertEquals(405, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(405, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
     }
 
@@ -354,14 +366,13 @@ class ServerMKCOLTest extends AbstractServer {
         $this->server->httpRequest = ($request);
         $this->server->exec();
 
-        $this->assertEquals(207, $this->response->status,'Wrong statuscode received. Full response body: ' .$this->response->body);
+        $this->assertEquals(207, $this->response->status, 'Wrong statuscode received. Full response body: ' .$this->response->body);
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
-
-
     }
 
 }
diff --git a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php
index d3ede33..bd20fd0 100644
--- a/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php
+++ b/tests/Sabre/DAV/ServerPropsInfiniteDepthTest.php
@@ -54,6 +54,7 @@ class ServerPropsInfiniteDepthTest extends AbstractServer {
         $this->assertEquals(207, $this->response->status, 'Incorrect status received. Full response body: ' . $this->response->getBodyAsString());
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Type' => 'application/xml; charset=utf-8',
                 'DAV' => '1, 3, extended-mkcol, 2',
                 'Vary' => 'Brief,Prefer',
diff --git a/tests/Sabre/DAV/ServerPropsTest.php b/tests/Sabre/DAV/ServerPropsTest.php
index 701b284..4ee7242 100644
--- a/tests/Sabre/DAV/ServerPropsTest.php
+++ b/tests/Sabre/DAV/ServerPropsTest.php
@@ -47,6 +47,7 @@ class ServerPropsTest extends AbstractServer {
         $this->assertEquals(207, $this->response->status);
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Type' => 'application/xml; charset=utf-8',
                 'DAV' => '1, 3, extended-mkcol, 2',
                 'Vary' => 'Brief,Prefer',
@@ -72,6 +73,7 @@ class ServerPropsTest extends AbstractServer {
         $this->assertEquals(207, $this->response->status);
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Type' => 'application/xml; charset=utf-8',
                 'DAV' => '1, 3, extended-mkcol, 2',
                 'Vary' => 'Brief,Prefer',
@@ -311,6 +313,7 @@ class ServerPropsTest extends AbstractServer {
         $this->server->exec();
 
         $this->assertEquals(array(
+                'X-Sabre-Version' => Version::VERSION,
                 'Content-Type' => 'application/xml; charset=utf-8',
                 'Vary' => 'Brief,Prefer',
             ),
@@ -365,4 +368,3 @@ class ServerPropsTest extends AbstractServer {
     }
 
 }
-
diff --git a/tests/Sabre/DAV/ServerRangeTest.php b/tests/Sabre/DAV/ServerRangeTest.php
index 0035ebd..b592681 100644
--- a/tests/Sabre/DAV/ServerRangeTest.php
+++ b/tests/Sabre/DAV/ServerRangeTest.php
@@ -26,6 +26,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 4,
             'Content-Range' => 'bytes 2-5/13',
@@ -56,6 +57,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 11,
             'Content-Range' => 'bytes 2-12/13',
@@ -86,6 +88,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 8,
             'Content-Range' => 'bytes 5-12/13',
@@ -157,6 +160,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 4,
             'Content-Range' => 'bytes 2-5/13',
@@ -190,6 +194,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -222,6 +227,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 4,
             'Content-Range' => 'bytes 2-5/13',
@@ -255,6 +261,7 @@ class ServerRangeTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php
index b8cb109..cae5ca7 100644
--- a/tests/Sabre/DAV/ServerSimpleTest.php
+++ b/tests/Sabre/DAV/ServerSimpleTest.php
@@ -52,6 +52,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -76,6 +77,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -135,6 +137,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -160,6 +163,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' .  filemtime($this->tempDir . '/test.txt'))),
@@ -225,6 +229,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
@@ -245,6 +250,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ),$this->response->headers);
 
@@ -276,6 +282,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/octet-stream',
             'Content-Length' => 13,
             'Last-Modified' => HTTP\Util::toHTTPDate(new \DateTime('@' . filemtime($this->tempDir . '/test.txt'))),
@@ -562,12 +569,13 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             ),
             $this->response->headers
          );
 
-        $this->assertEquals(415, $this->response->status,'We got an incorrect status back. Full response body follows: ' . $this->response->body);
+        $this->assertEquals(415, $this->response->status, 'We got an incorrect status back. Full response body follows: ' . $this->response->body);
 
     }
 
@@ -585,6 +593,7 @@ class ServerSimpleTest extends AbstractServer{
         $this->server->exec();
 
         $this->assertEquals(array(
+            'X-Sabre-Version' => Version::VERSION,
             'testheader' => 'testvalue',
             ),
             $this->response->headers
diff --git a/tests/Sabre/DAVACL/ExpandPropertiesTest.php b/tests/Sabre/DAVACL/ExpandPropertiesTest.php
index ca32e9c..0961439 100644
--- a/tests/Sabre/DAVACL/ExpandPropertiesTest.php
+++ b/tests/Sabre/DAVACL/ExpandPropertiesTest.php
@@ -69,6 +69,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status,'Incorrect status code received. Full body: ' . $server->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
@@ -131,6 +132,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status, 'Incorrect response status received. Full response body: ' . $server->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
@@ -195,6 +197,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
@@ -262,6 +265,7 @@ class ExpandPropertiesTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
diff --git a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
index bfaad94..60ad188 100644
--- a/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
+++ b/tests/Sabre/DAVACL/PrincipalPropertySearchTest.php
@@ -64,6 +64,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(400, $server->httpResponse->status);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
@@ -102,6 +103,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             'Vary'         => 'Brief,Prefer',
         ), $server->httpResponse->headers);
@@ -141,6 +143,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             'Vary'         => 'Brief,Prefer',
         ), $server->httpResponse->headers);
@@ -205,6 +208,7 @@ class PrincipalPropertySearchTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(207, $server->httpResponse->status, $server->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
             'Vary'         => 'Brief,Prefer',
         ), $server->httpResponse->headers);
diff --git a/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php b/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
index 96ba526..a8fb4d4 100644
--- a/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
+++ b/tests/Sabre/DAVACL/PrincipalSearchPropertySetTest.php
@@ -50,6 +50,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(400, $server->httpResponse->status);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
@@ -76,6 +77,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(400, $server->httpResponse->status, $server->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->headers);
 
@@ -102,6 +104,7 @@ class PrincipalSearchPropertySetTest extends \PHPUnit_Framework_TestCase {
 
         $this->assertEquals(200, $server->httpResponse->status, $server->httpResponse->body);
         $this->assertEquals(array(
+            'X-Sabre-Version' => DAV\Version::VERSION,
             'Content-Type' => 'application/xml; charset=utf-8',
         ), $server->httpResponse->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