[Pkg-owncloud-commits] [php-sabredav] 22/163: Fixed #422 for the 1.8 branch.

David Prévot taffit at moszumanska.debian.org
Tue May 20 18:54:50 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 a8545896553f98b4697b3149f3bbe2d0081628e7
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Mon Mar 24 21:05:36 2014 -0400

    Fixed #422 for the 1.8 branch.
---
 tests/Sabre/DAV/HttpPutTest.php     | 39 +++++++++++++++++++++----------------
 tests/Sabre/DAV/Mock/Collection.php | 16 +++++++++------
 tests/Sabre/DAV/Mock/File.php       |  6 +++++-
 3 files changed, 37 insertions(+), 24 deletions(-)

diff --git a/tests/Sabre/DAV/HttpPutTest.php b/tests/Sabre/DAV/HttpPutTest.php
index 47804c9..b145545 100644
--- a/tests/Sabre/DAV/HttpPutTest.php
+++ b/tests/Sabre/DAV/HttpPutTest.php
@@ -1,16 +1,21 @@
 <?php
 
+namespace Sabre\DAV;
+
+use Sabre\DAVServerTest;
+use Sabre\HTTP;
+
 /**
  * Tests related to the PUT request.
  *
  * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved.
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
- * @covers Sabre_DAV_Server::httpPut
- * @covers Sabre_DAV_Server::createFile
- * @covers Sabre_DAV_Server::checkPreconditions
+ * @covers Sabre\DAV\Server::httpPut
+ * @covers Sabre\DAV\Server::createFile
+ * @covers Sabre\DAV\Server::checkPreconditions
  */
-class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
+class HttpPutTest extends DAVServerTest {
 
     /**
      * Sets up the DAV tree.
@@ -19,7 +24,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function setUpTree() {
 
-        $this->tree = new Sabre_DAV_Mock_Collection('root', array(
+        $this->tree = new Mock\Collection('root', array(
             'file1' => 'foo',
         ));
 
@@ -30,7 +35,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPut() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
         ));
@@ -62,7 +67,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutExisting() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'PUT',
         ));
@@ -94,7 +99,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutExistingIfMatchStar() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_IF_MATCH' => '*',
@@ -127,7 +132,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutExistingIfMatchCorrect() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_IF_MATCH' => '"' . md5('foo') . '"',
@@ -160,7 +165,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutContentRange() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_CONTENT_RANGE' => 'bytes/100-200',
@@ -179,7 +184,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutIfNoneMatchStar() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_IF_NONE_MATCH' => '*',
@@ -212,7 +217,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutIfMatchStar() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_IF_MATCH' => '*',
@@ -232,7 +237,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutExistingIfNoneMatchStar() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_IF_NONE_MATCH' => '*',
@@ -252,7 +257,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testPutNoParent() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1/file2',
             'REQUEST_METHOD' => 'PUT',
         ));
@@ -272,7 +277,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testFinderPutSuccess() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_X_EXPECTED_ENTITY_LENGTH' => '5',
@@ -305,7 +310,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
      */
     public function testFinderPutFail() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
             'HTTP_X_EXPECTED_ENTITY_LENGTH' => '5',
@@ -325,7 +330,7 @@ class Sabre_DAV_HttpPutTest extends Sabre_DAVServerTest {
 
         $this->server->subscribeEvent('beforeBind', array($this, 'beforeBind'));
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'PUT',
         ));
diff --git a/tests/Sabre/DAV/Mock/Collection.php b/tests/Sabre/DAV/Mock/Collection.php
index d27dd3f..4bc9dd2 100644
--- a/tests/Sabre/DAV/Mock/Collection.php
+++ b/tests/Sabre/DAV/Mock/Collection.php
@@ -1,5 +1,9 @@
 <?php
 
+namespace Sabre\DAV\Mock;
+
+use Sabre\DAV;
+
 /**
  * Mock Collection.
  *
@@ -9,13 +13,13 @@
  * Every key a filename, every array value is either:
  *   * an array, for a sub-collection
  *   * a string, for a file
- *   * An instance of Sabre_DAV_INode.
+ *   * An instance of \Sabre\DAV\INode.
  *
  * @copyright Copyright (C) 2007-2014 fruux GmbH. All rights reserved.
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class Sabre_DAV_Mock_Collection extends Sabre_DAV_Collection {
+class Collection extends DAV\Collection {
 
     protected $name;
     protected $children;
@@ -96,19 +100,19 @@ class Sabre_DAV_Mock_Collection extends Sabre_DAV_Collection {
     /**
      * Returns an array with all the child nodes
      *
-     * @return Sabre_DAV_INode[]
+     * @return \Sabre\DAV\INode[]
      */
     public function getChildren() {
 
         $result = array();
         foreach($this->children as $key=>$value) {
 
-            if ($value instanceof Sabre_DAV_INode) {
+            if ($value instanceof DAV\INode) {
                 $result[] = $value;
             } elseif (is_array($value)) {
-                $result[] = new Sabre_DAV_Mock_Collection($key, $value);
+                $result[] = new Collection($key, $value);
             } else {
-                $result[] = new Sabre_DAV_Mock_File($key, $value);
+                $result[] = new File($key, $value);
             }
 
         }
diff --git a/tests/Sabre/DAV/Mock/File.php b/tests/Sabre/DAV/Mock/File.php
index c0927a0..ff627d7 100644
--- a/tests/Sabre/DAV/Mock/File.php
+++ b/tests/Sabre/DAV/Mock/File.php
@@ -1,5 +1,9 @@
 <?php
 
+namespace Sabre\DAV\Mock;
+
+use Sabre\DAV;
+
 /**
  * Mock File
  *
@@ -9,7 +13,7 @@
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class Sabre_DAV_Mock_File extends Sabre_DAV_File {
+class File extends DAV\File {
 
     protected $name;
     protected $contents;

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