33 $this->assertEquals($expected, $commonPrefix);
43 '/var/www/myhost.com/t3lib/' 45 '/var/www/myhost.com/t3lib/' 49 '/var/www/myhost.com/t3lib/',
50 '/var/www/myhost.com/t3lib/' 52 '/var/www/myhost.com/t3lib/' 56 '/var/www/myhost.com/typo3/',
57 '/var/www/myhost.com/t3lib/' 59 '/var/www/myhost.com/' 63 '/var/www/myhost.com/uploads/',
64 '/var/www/myhost.com/typo3/',
65 '/var/www/myhost.com/t3lib/' 67 '/var/www/myhost.com/' 71 '/var/www/myhost.com/uploads/directory/',
72 '/var/www/myhost.com/typo3/sysext/',
73 '/var/www/myhost.com/typo3/contrib/',
74 '/var/www/myhost.com/t3lib/utility/' 76 '/var/www/myhost.com/' 80 'C:\\www\\myhost.com\\t3lib\\' 82 'C:/www/myhost.com/t3lib/' 86 'C:\\www\\myhost.com\\t3lib\\',
87 'C:\\www\\myhost.com\\t3lib\\' 89 'C:/www/myhost.com/t3lib/' 93 'C:\\www\\myhost.com\\typo3\\',
94 'C:\\www\\myhost.com\\t3lib\\' 100 'C:\\www\\myhost.com\\uploads\\',
101 'C:\\www\\myhost.com\\typo3\\',
102 'C:\\www\\myhost.com\\t3lib\\' 108 'C:\\www\\myhost.com\\uploads\\directory\\',
109 'C:\\www\\myhost.com\\typo3\\sysext\\',
110 'C:\\www\\myhost.com\\typo3\\contrib\\',
111 'C:\\www\\myhost.com\\t3lib\\utility\\' 127 $this->assertEquals($expected, $relativePath);
137 PATH_site .
'directory',
141 PATH_site .
't3lib/',
142 PATH_site .
't3lib/',
146 PATH_site .
'typo3/',
147 PATH_site .
't3lib/',
152 PATH_site .
't3lib/',
156 PATH_site .
't3lib/',
157 PATH_site .
't3lib/stddb/',
161 PATH_site .
'typo3/sysext/cms/',
162 PATH_site .
't3lib/utility/',
163 '../../../t3lib/utility/' 177 $this->assertEquals($expected, $sanitizedPath);
185 array(
'/var/www//',
'/',
'/var/www/'),
186 array(
'/var/www/',
'/',
'/var/www/'),
187 array(
'/var/www',
'/',
'/var/www/')
203 'same folder' => array(
208 'preserve relative path if path goes above start path' => array(
213 'preserve absolute path even if path goes above start path' => array(
218 'base folder with same folder path' => array(
223 'base folder with parent folder path' => array(
240 $this->assertEquals($expectedFileName, $resolvedFilename);
250 'removes single-dot-elements' => array(
254 'removes ./ at beginning' => array(
258 'removes double-slashes' => array(
262 'removes double-slashes from front, but keeps absolute path' => array(
266 'makes double-dot-elements go one level higher, test #1' => array(
270 'makes double-dot-elements go one level higher, test #2' => array(
271 'abc/def/ghi/../123/456/..',
274 'makes double-dot-elements go one level higher, test #3' => array(
278 'makes double-dot-elements go one level higher, test #4' => array(
279 'abc/def/ghi//../123/456/..',
282 'truncates slash at the end' => array(
286 'keeps slash in front of absolute paths' => array(
290 'keeps slash in front of absolute paths even if double-dot-elements want to go higher' => array(
291 '/abc/../../def/ghi',
294 'works with EXT-syntax-paths' => array(
298 'truncates ending slash with space' => array(
302 'truncates ending space' => array(
306 'truncates ending dot' => array(
310 'does not truncates ending dot if part of name' => array(
314 'protocol is not removed' => array(
315 'vfs://def/../text.txt',
318 'works with filenames' => array(
322 'absolute windwos path' => array(
323 'C:\def\..\..\test.txt',
326 'double slashaes' => array(
330 'multiple slashes' => array(
342 $className = $this->
getUniqueId(
'PathUtilityFixture');
343 $fixtureClassString =
' 344 namespace ' . ltrim(__NAMESPACE__,
'\\') .
'; 345 class ' . $className .
' extends \\TYPO3\\CMS\\Core\\Utility\\PathUtility { 346 static public function isWindows() { 351 eval($fixtureClassString);
352 $fullyQualifiedClassName = __NAMESPACE__ .
'\\' . $className;
356 $fullyQualifiedClassName::getCanonicalPath($inputName)
isRelativePathResolvedCorrectly($source, $target, $expected)
static getCommonPrefix(array $paths)
isTrailingSeparatorSanitizedCorrectlyDataProvider()
getCanonicalPathCorrectlyCleansPathDataProvider()
static getAbsolutePathOfRelativeReferencedFileOrPath($baseFilenameOrPath, $includeFileName)
isTrailingSeparatorSanitizedCorrectly($path, $separator, $expected)
isRelativePathResolvedCorrectlyDataProvider()
isCommonPrefixResolvedCorrectly(array $paths, $expected)
static getRelativePath($sourcePath, $targetPath)
getCanonicalPathCorrectlyCleansPath($inputName, $expectedResult)
isCommonPrefixResolvedCorrectlyDataProvider()
getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectly($baseFileName, $includeFileName, $expectedFileName)
getAbsolutePathOfRelativeReferencedFileOrPathResolvesFileCorrectlyDataProvider()
static sanitizeTrailingSeparator($path, $separator='/')