Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-13 16:17:51 +0400
committerVincent Petry <pvince81@owncloud.com>2014-05-13 23:17:33 +0400
commit0c355cb1fb364ac8e31c15ebf601552eb1908664 (patch)
treef80854e6bf992721af14d5ee64cf1c631d17ff09 /tests
parent1e6b4576c2a99290f78b48a45c317a8b262d649f (diff)
Fixed getAbsolutePath case when path is "0"
Make sure to correctly check for string emptiness when the passed path is "0". Backport of bab8c1f from master
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/view.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index d793aebffab..c26c6f29fc0 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -578,4 +578,22 @@ class View extends \PHPUnit_Framework_TestCase {
$info2 = $view->getFileInfo('/test/test');
$this->assertEquals($info['etag'], $info2['etag']);
}
+
+ /**
+ * @dataProvider absolutePathProvider
+ */
+ public function testGetAbsolutePath($expectedPath, $relativePath) {
+ $view = new \OC\Files\View('/files');
+ $this->assertEquals($expectedPath, $view->getAbsolutePath($relativePath));
+ }
+
+ function absolutePathProvider() {
+ return array(
+ array('/files/', ''),
+ array('/files/0', '0'),
+ array('/files/', '/'),
+ array('/files/test', 'test'),
+ array('/files/test', '/test'),
+ );
+ }
}