[Pkg-owncloud-commits] [php-sabredav] 28/163: Adding PHP namespaces.

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 d4a6faaca702da4ab5d779759143b14dcfc517be
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Thu Apr 3 14:29:44 2014 -0400

    Adding PHP namespaces.
---
 tests/Sabre/DAV/HttpDeleteTest.php  | 19 ++++++++++++-------
 tests/Sabre/DAV/Mock/Collection.php |  4 ++--
 tests/Sabre/DAV/Mock/File.php       |  2 +-
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/Sabre/DAV/HttpDeleteTest.php b/tests/Sabre/DAV/HttpDeleteTest.php
index 2ddc611..da28b69 100644
--- a/tests/Sabre/DAV/HttpDeleteTest.php
+++ b/tests/Sabre/DAV/HttpDeleteTest.php
@@ -1,5 +1,10 @@
 <?php
 
+namespace Sabre\DAV;
+
+use Sabre\DAVServerTest;
+use Sabre\HTTP;
+
 /**
  * Tests related to the PUT request.
  *
@@ -7,7 +12,7 @@
  * @author Evert Pot (http://evertpot.com/)
  * @license http://sabre.io/license/ Modified BSD License
  */
-class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
+class HttpDeleteTest extends DAVServerTest {
 
     /**
      * Sets up the DAV tree.
@@ -16,7 +21,7 @@ class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
      */
     public function setUpTree() {
 
-        $this->tree = new Sabre_DAV_Mock_Collection('root', array(
+        $this->tree = new Mock\Collection('root', array(
             'file1' => 'foo',
             'dir' => array(
                 'subfile' => 'bar',
@@ -31,7 +36,7 @@ class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
      */
     public function testDelete() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'DELETE',
         ));
@@ -58,7 +63,7 @@ class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
      */
     public function testDeleteDirectory() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/dir',
             'REQUEST_METHOD' => 'DELETE',
         ));
@@ -85,7 +90,7 @@ class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
      */
     public function testDeleteNotFound() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file2',
             'REQUEST_METHOD' => 'DELETE',
         ));
@@ -105,7 +110,7 @@ class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
      */
     public function testDeletePreconditions() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'DELETE',
             'HTTP_IF_MATCH' => '"' . md5('foo') . '"',
@@ -126,7 +131,7 @@ class Sabre_DAV_HttpDeleteTest extends Sabre_DAVServerTest {
      */
     public function testDeletePreconditionsFailed() {
 
-        $request = new Sabre_HTTP_Request(array(
+        $request = new HTTP\Request(array(
             'REQUEST_URI' => '/file1',
             'REQUEST_METHOD' => 'DELETE',
             'HTTP_IF_MATCH' => '"' . md5('bar') . '"',
diff --git a/tests/Sabre/DAV/Mock/Collection.php b/tests/Sabre/DAV/Mock/Collection.php
index 6848cad..b2613ec 100644
--- a/tests/Sabre/DAV/Mock/Collection.php
+++ b/tests/Sabre/DAV/Mock/Collection.php
@@ -32,7 +32,7 @@ class Collection extends DAV\Collection {
      * @param array $children
      * @return void
      */
-    public function __construct($name, array $children = array(), Sabre_DAV_Mock_Collection $parent = null) {
+    public function __construct($name, array $children = array(), Collection $parent = null) {
 
         $this->name = $name;
         $this->children = $children;
@@ -133,7 +133,7 @@ class Collection extends DAV\Collection {
 
         foreach($this->children as $key=>$value) {
 
-            if ($value instanceof Sabre_DAV_INode) {
+            if ($value instanceof DAV\INode) {
                 if ($value->getName() == $name) {
                     unset($this->children[$key]);
                     return;
diff --git a/tests/Sabre/DAV/Mock/File.php b/tests/Sabre/DAV/Mock/File.php
index 46056a8..2b25bbb 100644
--- a/tests/Sabre/DAV/Mock/File.php
+++ b/tests/Sabre/DAV/Mock/File.php
@@ -26,7 +26,7 @@ class File extends DAV\File {
      * @param array $children
      * @return void
      */
-    public function __construct($name, $contents, Sabre_DAV_Mock_Collection $parent) {
+    public function __construct($name, $contents, Collection $parent) {
 
         $this->name = $name;
         $this->put($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