diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-08-14 02:44:45 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-08-14 02:44:45 +0200 |
commit | 0c8ce0bb32c4a79c248e71533f9fa00b844049fb (patch) | |
tree | 94764ed5d50bf2a2e751fa413231f49cfdb24670 /tests | |
parent | c31217125293c405941c1b515cb94bdf0a14a35b (diff) | |
download | nextcloud-server-0c8ce0bb32c4a79c248e71533f9fa00b844049fb.tar.gz nextcloud-server-0c8ce0bb32c4a79c248e71533f9fa00b844049fb.zip |
some basic path normalization
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/filesystem.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php index 3e28d8c06e5..e041255ec91 100644 --- a/tests/lib/filesystem.php +++ b/tests/lib/filesystem.php @@ -59,6 +59,17 @@ class Test_Filesystem extends UnitTestCase{ $this->assertEqual('/',OC_Filesystem::getMountPoint('/some')); $this->assertEqual('folder',OC_Filesystem::getInternalPath('/some/folder')); } + + public function testNormalize(){ + $this->assertEqual('/path',OC_Filesystem::normalizePath('/path/')); + $this->assertEqual('/path',OC_Filesystem::normalizePath('path')); + $this->assertEqual('/path',OC_Filesystem::normalizePath('\path')); + $this->assertEqual('/foo/bar',OC_Filesystem::normalizePath('/foo//bar/')); + $this->assertEqual('/foo/bar',OC_Filesystem::normalizePath('/foo////bar')); + if(class_exists('Normalizer')){ + $this->assertEqual("/foo/bar\xC3\xBC",OC_Filesystem::normalizePath("/foo/baru\xCC\x88")); + } + } } ?>
\ No newline at end of file |