diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-03-19 16:53:37 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-03-19 16:53:37 +0100 |
commit | 0fff3c9698b036a4295935569db7220068f9883f (patch) | |
tree | 43e7b217050db93372a4028b0d67f68d134d007a /tests/lib/files | |
parent | a0ae2ab11a4dbbd1df19b51237029b1fcb942a56 (diff) | |
download | nextcloud-server-0fff3c9698b036a4295935569db7220068f9883f.tar.gz nextcloud-server-0fff3c9698b036a4295935569db7220068f9883f.zip |
adding extension to slugified physical path
Diffstat (limited to 'tests/lib/files')
-rw-r--r-- | tests/lib/files/mapper.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/lib/files/mapper.php b/tests/lib/files/mapper.php new file mode 100644 index 00000000000..36221f8bcaa --- /dev/null +++ b/tests/lib/files/mapper.php @@ -0,0 +1,41 @@ +<?php +/** + * ownCloud + * + * @author Robin Appelman + * @copyright 2012 Robin Appelman icewind@owncloud.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace Test\Files; + +class Mapper extends \PHPUnit_Framework_TestCase { + + /** + * @var \OC\Files\Mapper + */ + private $mapper = null; + + public function setUp() { + $this->mapper = new \OC\Files\Mapper('D:/'); + } + + public function testSlugifyPath() { + $this->assertEquals('D:/text.txt', $this->mapper->slugifyPath('D:/text.txt')); + $this->assertEquals('D:/text-2.txt', $this->mapper->slugifyPath('D:/text.txt', 2)); + $this->assertEquals('D:/a/b/text.txt', $this->mapper->slugifyPath('D:/a/b/text.txt')); + } +} |