[Pkg-owncloud-commits] [php-sabredav] 90/163: Merge branch '1.7' into 1.8

David Prévot taffit at moszumanska.debian.org
Tue May 20 18:54:57 UTC 2014


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

taffit pushed a commit to annotated tag upstream/2.0.0_beta1
in repository php-sabredav.

commit 3d0a64d39854973088ece915a936c39d8302c16c
Merge: 48f61b6 ad2dc53
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Sun Apr 27 22:55:16 2014 -0400

    Merge branch '1.7' into 1.8
    
    Conflicts:
    	lib/Sabre/DAV/PartialUpdate/Plugin.php

 lib/Sabre/DAV/Exception/LengthRequired.php          |  8 +++++---
 lib/Sabre/DAV/PartialUpdate/Plugin.php              | 15 ++++++++-------
 tests/Sabre/DAV/FSExt/FileTest.php                  |  8 ++++----
 tests/Sabre/DAV/PartialUpdate/PluginTest.php        |  4 ++--
 tests/Sabre/DAV/PartialUpdate/SpecificationTest.php | 20 +++++++++++++-------
 5 files changed, 32 insertions(+), 23 deletions(-)

diff --cc lib/Sabre/DAV/Exception/LengthRequired.php
index 6d45e6c,6d45e6c..9487686
--- a/lib/Sabre/DAV/Exception/LengthRequired.php
+++ b/lib/Sabre/DAV/Exception/LengthRequired.php
@@@ -1,18 -1,18 +1,20 @@@
  <?php
  
++namespace Sabre\DAV\Exception;
++
++use Sabre\DAV;
++
  /**
   * LengthRequired
   *
   * This exception is thrown when a request was made that required a
   * Content-Length header, but did not contain one.
   *
-- * @package Sabre
-- * @subpackage DAV
   * @copyright Copyright (C) 2007-2014 fruux GmbH (https://fruux.com/).
   * @author Evert Pot (http://evertpot.com/)
   * @license http://sabre.io/license/ Modified BSD License
   */
--class Sabre_DAV_Exception_LengthRequired extends Sabre_DAV_Exception {
++class LengthRequired extends DAV\Exception {
  
      /**
       * Returns the HTTP statuscode for this exception
diff --cc lib/Sabre/DAV/PartialUpdate/Plugin.php
index eb95107,a6f863c..2c402dc
--- a/lib/Sabre/DAV/PartialUpdate/Plugin.php
+++ b/lib/Sabre/DAV/PartialUpdate/Plugin.php
@@@ -98,12 -95,13 +98,13 @@@ class Plugin extends DAV\ServerPlugin 
      public function getHTTPMethods($uri) {
  
          $tree = $this->server->tree;
-         if ($tree->nodeExists($uri) && 
-             $tree->getNodeForPath($uri) instanceof IFile) {
 -
 -        if ($tree->nodeExists($uri) &&
 -            ($tree->getNodeForPath($uri) instanceof Sabre_DAV_PartialUpdate_IFile || $tree->getNodeForPath($uri) instanceof Sabre_DAV_PartialUpdate_IPatchSupport)) {
--            return array('PATCH');
--         }
--
--         return array();
++        if ($tree->nodeExists($uri)) {
++            $node = $tree->getNodeForPath($uri);
++            if ($node instanceof IFile || $node instanceof IPatchSupport) {
++                return array('PATCH');
++            }
++        }
++        return array();
  
      }
  
@@@ -177,7 -175,7 +178,7 @@@
          $body = $this->server->httpRequest->getBody();
  
  
--        if ($node instanceof Sabre_DAV_PartialUpdate_IPatchSupport) {
++        if ($node instanceof IPatchSupport) {
              $etag = $node->patch($body, $range[0], isset($range[1])?$range[1]:null);
          } else {
              // The old interface
diff --cc tests/Sabre/DAV/FSExt/FileTest.php
index 265f9f1,aedc26b..8947c66
--- a/tests/Sabre/DAV/FSExt/FileTest.php
+++ b/tests/Sabre/DAV/FSExt/FileTest.php
@@@ -32,11 -28,11 +32,11 @@@ class FileTest extends \PHPUnit_Framewo
  
      function testRange() {
  
 -       $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
 +       $file = new 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'));
  
      }
  
@@@ -46,11 -42,11 +46,11 @@@
         fwrite($stream, "222");
         rewind($stream);
  
 -       $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
 +       $file = new 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 --cc tests/Sabre/DAV/PartialUpdate/SpecificationTest.php
index b90d1ed,b90d1ed..7abe69c
--- a/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php
+++ b/tests/Sabre/DAV/PartialUpdate/SpecificationTest.php
@@@ -1,23 -1,23 +1,29 @@@
  <?php
  
++namespace Sabre\DAV\PartialUpdate;
++
++use Sabre\DAV\FSExt\File;
++use Sabre\DAV\Server;
++use Sabre\HTTP;
++
  /**
   * This test is an end-to-end sabredav test that goes through all
   * the cases in the specification.
   *
   * See: http://sabre.io/dav/http-patch/
   */
--class Sabre_DAV_PartialUpdate_SpecificationTest extends PHPUnit_Framework_TestCase {
++class SpecificationTest extends \PHPUnit_Framework_TestCase {
  
      protected $server;
  
      public function setUp() {
  
          $tree = array(
--            new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/foobar.txt')
++            new File(SABRE_TEMPDIR . '/foobar.txt')
          );
--        $server = new Sabre_DAV_Server($tree);
++        $server = new Server($tree);
          $server->debugExceptions = true;
--        $server->addPlugin(new Sabre_DAV_PartialUpdate_Plugin());
++        $server->addPlugin(new Plugin());
  
          $tree[0]->put('1234567890');
  
@@@ -27,7 -27,7 +33,7 @@@
  
      public function tearDown() {
  
--        Sabre_TestUtil::clearTempDir();
++        \Sabre\TestUtil::clearTempDir();
  
      }
  
@@@ -46,11 -46,11 +52,11 @@@
              $vars['HTTP_CONTENT_LENGTH'] = (string)$contentLength;
          }
  
--        $request = new Sabre_HTTP_Request($vars);
++        $request = new HTTP\Request($vars);
  
          $request->setBody('----');
          $this->server->httpRequest = $request;
--        $this->server->httpResponse = new Sabre_HTTP_ResponseMock();
++        $this->server->httpResponse = new HTTP\ResponseMock();
          $this->server->exec();
  
          $this->assertEquals($httpStatus, $this->server->httpResponse->status, 'Incorrect http status received: ' . $this->server->httpResponse->body);

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