[Pkg-owncloud-commits] [php-sabredav] 02/66: Fixed unittests.

David Prévot taffit at moszumanska.debian.org
Wed May 27 13:56:42 UTC 2015


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

taffit pushed a commit to tag 3.0.0-alpha1
in repository php-sabredav.

commit 7ea51af1e6c18a11bda6b679859ae062858c32e7
Author: Evert Pot <me at evertpot.com>
Date:   Mon Apr 13 14:06:10 2015 -0400

    Fixed unittests.
---
 lib/DAV/Browser/Plugin.php             |  2 +-
 tests/Sabre/DAV/Browser/PluginTest.php | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/DAV/Browser/Plugin.php b/lib/DAV/Browser/Plugin.php
index 1d41743..1d06ea6 100644
--- a/lib/DAV/Browser/Plugin.php
+++ b/lib/DAV/Browser/Plugin.php
@@ -251,7 +251,7 @@ class Plugin extends DAV\ServerPlugin {
      */
     function generateDirectoryIndex($path) {
 
-        $html = $this->generateHeader($path, $path);
+        $html = $this->generateHeader($path?$path:'/', $path);
 
         $node = $this->server->tree->getNodeForPath($path);
         if ($node instanceof DAV\ICollection) {
diff --git a/tests/Sabre/DAV/Browser/PluginTest.php b/tests/Sabre/DAV/Browser/PluginTest.php
index fd781c0..4711e5d 100644
--- a/tests/Sabre/DAV/Browser/PluginTest.php
+++ b/tests/Sabre/DAV/Browser/PluginTest.php
@@ -35,8 +35,9 @@ class PluginTest extends DAV\AbstractServer{
             $this->response->getHeaders()
         );
 
-        $this->assertTrue(strpos($this->response->body, '<title>dir/') !== false);
-        $this->assertTrue(strpos($this->response->body, '<a href="/dir/child.txt">')!==false);
+        $body = $this->response->getBodyAsString();
+        $this->assertTrue(strpos($body, '<title>dir') !== false, $body);
+        $this->assertTrue(strpos($body, '<a href="/dir/child.txt">')!==false);
 
     }
     function testCollectionGetRoot() {
@@ -55,9 +56,10 @@ class PluginTest extends DAV\AbstractServer{
             $this->response->getHeaders()
         );
 
-        $this->assertTrue(strpos($this->response->body, '<title>/') !== false);
-        $this->assertTrue(strpos($this->response->body, '<a href="/dir/">')!==false);
-        $this->assertTrue(strpos($this->response->body, '<span class="btn disabled">')!==false);
+        $body = $this->response->getBodyAsString();
+        $this->assertTrue(strpos($body, '<title>/') !== false, $body);
+        $this->assertTrue(strpos($body, '<a href="/dir/">')!==false);
+        $this->assertTrue(strpos($body, '<span class="btn disabled">')!==false);
 
     }
 

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