[Pkg-owncloud-commits] [php-sabredav] 18/24: More bugfixes for #439.

David Prévot taffit at moszumanska.debian.org
Tue May 20 17:19:43 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch 1.7
in repository php-sabredav.

commit ad2dc5328356988720babc35b13ad9755c4534ec
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sun Apr 27 22:44:14 2014 -0400

    More bugfixes for #439.
---
 lib/Sabre/DAV/PartialUpdate/Plugin.php       | 2 +-
 tests/Sabre/DAV/FSExt/FileTest.php           | 8 ++++----
 tests/Sabre/DAV/PartialUpdate/PluginTest.php | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/Sabre/DAV/PartialUpdate/Plugin.php b/lib/Sabre/DAV/PartialUpdate/Plugin.php
index 416fdd8..a6f863c 100644
--- a/lib/Sabre/DAV/PartialUpdate/Plugin.php
+++ b/lib/Sabre/DAV/PartialUpdate/Plugin.php
@@ -97,7 +97,7 @@ class Sabre_DAV_PartialUpdate_Plugin extends Sabre_DAV_ServerPlugin {
         $tree = $this->server->tree;
 
         if ($tree->nodeExists($uri) &&
-            $tree->getNodeForPath($uri) instanceof Sabre_DAV_PartialUpdate_IFile) {
+            ($tree->getNodeForPath($uri) instanceof Sabre_DAV_PartialUpdate_IFile || $tree->getNodeForPath($uri) instanceof Sabre_DAV_PartialUpdate_IPatchSupport)) {
             return array('PATCH');
          }
 
diff --git a/tests/Sabre/DAV/FSExt/FileTest.php b/tests/Sabre/DAV/FSExt/FileTest.php
index ce28a41..aedc26b 100644
--- a/tests/Sabre/DAV/FSExt/FileTest.php
+++ b/tests/Sabre/DAV/FSExt/FileTest.php
@@ -30,9 +30,9 @@ class Sabre_DAV_FSExt_FileTest extends PHPUnit_Framework_TestCase {
 
        $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
        $file->put('0000000');
-       $file->putRange('111',3);
+       $file->patch('111', 2, 3);
 
-       $this->assertEquals('0011100',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
+       $this->assertEquals('0001110',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
 
     }
 
@@ -44,9 +44,9 @@ class Sabre_DAV_FSExt_FileTest extends PHPUnit_Framework_TestCase {
 
        $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
        $file->put('0000000');
-       $file->putRange($stream,3);
+       $file->patch($stream, 2, 3);
 
-       $this->assertEquals('0022200',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
+       $this->assertEquals('0002220',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
 
     }
 
diff --git a/tests/Sabre/DAV/PartialUpdate/PluginTest.php b/tests/Sabre/DAV/PartialUpdate/PluginTest.php
index aa7d671..58b50af 100644
--- a/tests/Sabre/DAV/PartialUpdate/PluginTest.php
+++ b/tests/Sabre/DAV/PartialUpdate/PluginTest.php
@@ -98,7 +98,7 @@ class Sabre_DAV_PartialUpdate_PluginTest extends Sabre_DAVServerTest {
         );
         $response = $this->request($request);
 
-        $this->assertEquals('HTTP/1.1 416 Requested Range Not Satisfiable', $response->status, 'Full response body:' . $response->body);
+        $this->assertEquals('HTTP/1.1 411 Length Required', $response->status, 'Full response body:' . $response->body);
 
     }
 
@@ -118,7 +118,7 @@ class Sabre_DAV_PartialUpdate_PluginTest extends Sabre_DAVServerTest {
         $response = $this->request($request);
 
         $this->assertEquals('HTTP/1.1 204 No Content', $response->status, 'Full response body:' . $response->body);
-        $this->assertEquals('00111000', $this->node->get());
+        $this->assertEquals('00011100', $this->node->get());
 
     }
 

-- 
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