[Pkg-owncloud-commits] [php-sabredav] 12/23: Update Issue 33

David Prévot taffit at moszumanska.debian.org
Sat Nov 30 15:44:01 UTC 2013


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

taffit pushed a commit to tag version-1.0.12
in repository php-sabredav.

commit 1fd736399e5379cea55d826d9fbe0de0655d2dc5
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Mon Mar 29 18:22:26 2010 +0900

    Update Issue 33
    
    Added some tests with examples taken from issue tracker
---
 tests/Sabre/DAV/ServerSimpleTest.php | 34 ++++++++++++++++++++++++++++++++++
 tests/Sabre/DAV/URLUtilTest.php      | 13 +++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/tests/Sabre/DAV/ServerSimpleTest.php b/tests/Sabre/DAV/ServerSimpleTest.php
index 7420cb4..a330e00 100644
--- a/tests/Sabre/DAV/ServerSimpleTest.php
+++ b/tests/Sabre/DAV/ServerSimpleTest.php
@@ -361,6 +361,40 @@ class Sabre_DAV_ServerSimpleTest extends Sabre_DAV_AbstractServer{
 
     }
 
+    function testCalculateUriSpecialChars() {
+
+        $uris = array(
+            'http://www.example.org/root/%C3%A0fo%C3%B3',
+            '/root/%C3%A0fo%C3%B3',
+            '/root/%C3%A0fo%C3%B3/'
+        );
+
+        $this->server->setBaseUri('/root/');
+
+        foreach($uris as $uri) {
+
+            $this->assertEquals("\xc3\xa0fo\xc3\xb3",$this->server->calculateUri($uri));
+
+        }
+
+        $this->server->setBaseUri('/root');
+
+        foreach($uris as $uri) {
+
+            $this->assertEquals("\xc3\xa0fo\xc3\xb3",$this->server->calculateUri($uri));
+
+        }
+       
+        $this->server->setBaseUri('/');
+
+        foreach($uris as $uri) {
+
+            $this->assertEquals("root/\xc3\xa0fo\xc3\xb3",$this->server->calculateUri($uri));
+
+        }
+
+    }
+
     function testBaseUriCheck() {
 
         $uris = array(
diff --git a/tests/Sabre/DAV/URLUtilTest.php b/tests/Sabre/DAV/URLUtilTest.php
index e3c7de2..97fda5f 100644
--- a/tests/Sabre/DAV/URLUtilTest.php
+++ b/tests/Sabre/DAV/URLUtilTest.php
@@ -78,4 +78,17 @@ class Sabre_DAV_URLUtilTest extends PHPUnit_Framework_TestCase{
 
     }
 
+    /**
+     * This testcase was sent by a bug reporter
+     * 
+     * @depends testDecode
+     */
+    function testDecodeAccentsWindows7() {
+        
+        $str = '/webdav/%C3%A0fo%C3%B3';
+        $newStr = Sabre_DAV_URLUtil::decodePath($str);
+        $this->assertEquals(strtolower($str),Sabre_DAV_URLUtil::encodePath($newStr));
+
+    }
+
 }

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