summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/FilesystemTest.php129
1 files changed, 68 insertions, 61 deletions
diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php
index a98af220ba1..6fc6fbe9d7c 100644
--- a/tests/lib/Files/FilesystemTest.php
+++ b/tests/lib/Files/FilesystemTest.php
@@ -115,73 +115,80 @@ class FilesystemTest extends \Test\TestCase {
}
public function normalizePathData() {
- return array(
- array('/', ''),
- array('/', '/'),
- array('/', '//'),
- array('/', '/', false),
- array('/', '//', false),
-
- array('/path', '/path/'),
- array('/path/', '/path/', false),
- array('/path', 'path'),
-
- array('/foo/bar', '/foo//bar/'),
- array('/foo/bar/', '/foo//bar/', false),
- array('/foo/bar', '/foo////bar'),
- array('/foo/bar', '/foo/////bar'),
- array('/foo/bar', '/foo/bar/.'),
- array('/foo/bar', '/foo/bar/./'),
- array('/foo/bar/', '/foo/bar/./', false),
- array('/foo/bar', '/foo/bar/./.'),
- array('/foo/bar', '/foo/bar/././'),
- array('/foo/bar/', '/foo/bar/././', false),
- array('/foo/bar', '/foo/./bar/'),
- array('/foo/bar/', '/foo/./bar/', false),
- array('/foo/.bar', '/foo/.bar/'),
- array('/foo/.bar/', '/foo/.bar/', false),
- array('/foo/.bar/tee', '/foo/.bar/tee'),
+ return [
+ ['/', ''],
+ ['/', '/'],
+ ['/', '//'],
+ ['/', '/', false],
+ ['/', '//', false],
+
+ ['/path', '/path/'],
+ ['/path/', '/path/', false],
+ ['/path', 'path'],
+
+ ['/foo/bar', '/foo//bar/'],
+ ['/foo/bar/', '/foo//bar/', false],
+ ['/foo/bar', '/foo////bar'],
+ ['/foo/bar', '/foo/////bar'],
+ ['/foo/bar', '/foo/bar/.'],
+ ['/foo/bar', '/foo/bar/./'],
+ ['/foo/bar/', '/foo/bar/./', false],
+ ['/foo/bar', '/foo/bar/./.'],
+ ['/foo/bar', '/foo/bar/././'],
+ ['/foo/bar/', '/foo/bar/././', false],
+ ['/foo/bar', '/foo/./bar/'],
+ ['/foo/bar/', '/foo/./bar/', false],
+ ['/foo/.bar', '/foo/.bar/'],
+ ['/foo/.bar/', '/foo/.bar/', false],
+ ['/foo/.bar/tee', '/foo/.bar/tee'],
+
+ ['/foo/bar', '/.///././//./foo/.///././//./bar/./././.'],
+ ['/foo/bar/', '/.///././//./foo/.///././//./bar/./././.', false],
+ ['/foo/bar', '/.///././//./foo/.///././//./bar/././././'],
+ ['/foo/bar/', '/.///././//./foo/.///././//./bar/././././', false],
// Windows paths
- array('/', ''),
- array('/', '\\'),
- array('/', '\\', false),
- array('/', '\\\\'),
- array('/', '\\\\', false),
-
- array('/path', '\\path'),
- array('/path', '\\path', false),
- array('/path', '\\path\\'),
- array('/path/', '\\path\\', false),
-
- array('/foo/bar', '\\foo\\\\bar\\'),
- array('/foo/bar/', '\\foo\\\\bar\\', false),
- array('/foo/bar', '\\foo\\\\\\\\bar'),
- array('/foo/bar', '\\foo\\\\\\\\\\bar'),
- array('/foo/bar', '\\foo\\bar\\.'),
- array('/foo/bar', '\\foo\\bar\\.\\'),
- array('/foo/bar/', '\\foo\\bar\\.\\', false),
- array('/foo/bar', '\\foo\\bar\\.\\.'),
- array('/foo/bar', '\\foo\\bar\\.\\.\\'),
- array('/foo/bar/', '\\foo\\bar\\.\\.\\', false),
- array('/foo/bar', '\\foo\\.\\bar\\'),
- array('/foo/bar/', '\\foo\\.\\bar\\', false),
- array('/foo/.bar', '\\foo\\.bar\\'),
- array('/foo/.bar/', '\\foo\\.bar\\', false),
- array('/foo/.bar/tee', '\\foo\\.bar\\tee'),
+ ['/', ''],
+ ['/', '\\'],
+ ['/', '\\', false],
+ ['/', '\\\\'],
+ ['/', '\\\\', false],
+
+ ['/path', '\\path'],
+ ['/path', '\\path', false],
+ ['/path', '\\path\\'],
+ ['/path/', '\\path\\', false],
+
+ ['/foo/bar', '\\foo\\\\bar\\'],
+ ['/foo/bar/', '\\foo\\\\bar\\', false],
+ ['/foo/bar', '\\foo\\\\\\\\bar'],
+ ['/foo/bar', '\\foo\\\\\\\\\\bar'],
+ ['/foo/bar', '\\foo\\bar\\.'],
+ ['/foo/bar', '\\foo\\bar\\.\\'],
+ ['/foo/bar/', '\\foo\\bar\\.\\', false],
+ ['/foo/bar', '\\foo\\bar\\.\\.'],
+ ['/foo/bar', '\\foo\\bar\\.\\.\\'],
+ ['/foo/bar/', '\\foo\\bar\\.\\.\\', false],
+ ['/foo/bar', '\\foo\\.\\bar\\'],
+ ['/foo/bar/', '\\foo\\.\\bar\\', false],
+ ['/foo/.bar', '\\foo\\.bar\\'],
+ ['/foo/.bar/', '\\foo\\.bar\\', false],
+ ['/foo/.bar/tee', '\\foo\\.bar\\tee'],
// Absolute windows paths NOT marked as absolute
- array('/C:', 'C:\\'),
- array('/C:/', 'C:\\', false),
- array('/C:/tests', 'C:\\tests'),
- array('/C:/tests', 'C:\\tests', false),
- array('/C:/tests', 'C:\\tests\\'),
- array('/C:/tests/', 'C:\\tests\\', false),
+ ['/C:', 'C:\\'],
+ ['/C:/', 'C:\\', false],
+ ['/C:/tests', 'C:\\tests'],
+ ['/C:/tests', 'C:\\tests', false],
+ ['/C:/tests', 'C:\\tests\\'],
+ ['/C:/tests/', 'C:\\tests\\', false],
+ ['/C:/tests/bar', 'C:\\tests\\.\\.\\bar'],
+ ['/C:/tests/bar/', 'C:\\tests\\.\\.\\bar\\.\\', false],
// normalize does not resolve '..' (by design)
- array('/foo/..', '/foo/../'),
- array('/foo/..', '\\foo\\..\\'),
- );
+ ['/foo/..', '/foo/../'],
+ ['/foo/..', '\\foo\\..\\'],
+ ];
}
/**