[Pkg-owncloud-commits] [php-sabredav] 109/148: A few more tests.

David Prévot taffit at moszumanska.debian.org
Wed Apr 15 01:37:25 UTC 2015


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

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

commit 0bf1a9c645e21a6c3f68b8cd2a611516db609eb9
Author: Evert Pot <me at evertpot.com>
Date:   Wed Apr 1 15:28:33 2015 -0400

    A few more tests.
---
 lib/DAV/FSExt/Directory.php          |  2 +-
 tests/Sabre/DAV/ServerEventsTest.php | 29 +++++++++++++++++++++++++++++
 tests/Sabre/DAV/ServerSimpleTest.php | 12 ++++++++++++
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/lib/DAV/FSExt/Directory.php b/lib/DAV/FSExt/Directory.php
index e1f7c6a..c296817 100644
--- a/lib/DAV/FSExt/Directory.php
+++ b/lib/DAV/FSExt/Directory.php
@@ -201,7 +201,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota, DAV\IMoveTa
 
         // We only support FSExt\Directory or FSExt\File objects, so
         // anything else we want to quickly reject.
-        if (!$sourceNode instanceof Node) {
+        if (!$sourceNode instanceof Directory && !$sourceNode instanceof File) {
             return false;
         }
 
diff --git a/tests/Sabre/DAV/ServerEventsTest.php b/tests/Sabre/DAV/ServerEventsTest.php
index 1bf6feb..7f995c6 100644
--- a/tests/Sabre/DAV/ServerEventsTest.php
+++ b/tests/Sabre/DAV/ServerEventsTest.php
@@ -89,4 +89,33 @@ class ServerEventsTest extends AbstractServer {
 
     }
 
+    function testMethod() {
+
+        $k = 1;
+        $this->server->on('method', function() use (&$k) {
+
+            $k+=1;
+
+            return false;
+
+        });
+        $this->server->on('method', function() use (&$k) {
+
+            $k+=2;
+
+            return false;
+
+        });
+
+        $this->server->invokeMethod(
+            new HTTP\Request('BLABLA', '/'),
+            new HTTP\Response(),
+            false
+        );
+
+        $this->assertEquals(2, $k);
+
+
+    }
+
 }
diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php
index cbe9017..99742bd 100644
--- a/tests/Sabre/DAV/ServerSimpleTest.php
+++ b/tests/Sabre/DAV/ServerSimpleTest.php
@@ -213,6 +213,18 @@ class ServerSimpleTest extends AbstractServer{
     }
 
     /**
+     * @expectedException \Sabre\DAV\Exception\Forbidden
+     */
+    function testCalculateUriBreakout() {
+
+        $uri = '/path1/';
+
+        $this->server->setBaseUri('/path2/');
+        $this->server->calculateUri($uri);
+
+    }
+
+    /**
      */
     function testGuessBaseUri() {
 

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