From c0b210f0d5b4953fc9a437d82ac6af1a4b482909 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Fri, 5 Jul 2013 15:02:41 +0300 Subject: [PATCH] Add unit test --- tests/lib/util.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/lib/util.php b/tests/lib/util.php index 1f25382592..9742d57ac7 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -37,6 +37,12 @@ class Test_Util extends PHPUnit_Framework_TestCase { $result = OC_Util::sanitizeHTML($goodString); $this->assertEquals("This is an harmless string.", $result); } + + function testEncodePath(){ + $component = '/§#@test%&^ä/-child'; + $result = OC_Util::encodePath($component); + $this->assertEquals("/%C2%A7%23%40test%25%26%5E%C3%A4/-child", $result); + } function testGenerate_random_bytes() { $result = strlen(OC_Util::generate_random_bytes(59));