From 0fff3c9698b036a4295935569db7220068f9883f Mon Sep 17 00:00:00 2001 From: Thomas Mueller <thomas.mueller@tmit.eu> Date: Tue, 19 Mar 2013 16:53:37 +0100 Subject: adding extension to slugified physical path --- tests/lib/files/mapper.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/lib/files/mapper.php (limited to 'tests') 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')); + } +} -- cgit v1.2.3