[BUGFIX] GeneralUtilityTest does non use absolute path 58/20558/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 6 May 2013 19:54:46 +0000 (21:54 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 6 May 2013 20:01:44 +0000 (22:01 +0200)
Some of the 'link' tests for rmdir do not use absolute paths and
only give desired results if current directory is the document root.

Change-Id: I4a06c1a158175e939e70639627bb8e93e7b773fa
Resolves: #47997
Related: #47459
Releases: 6.2
Reviewed-on: https://review.typo3.org/20558
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php

index 8883360..95495d1 100644 (file)
@@ -3201,7 +3201,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $existingDirectory = PATH_site . 'typo3temp/' . uniqid('notExists_') . '/';
                mkdir($existingDirectory);
                $this->testFilesToDelete[] = $existingDirectory;
-               $symlinkName = 'typo3temp/' . uniqid('link_');
+               $symlinkName = PATH_site . 'typo3temp/' . uniqid('link_');
                symlink($existingDirectory, $symlinkName);
                Utility\GeneralUtility::rmdir($symlinkName, TRUE);
                $this->assertFalse(is_link($symlinkName));
@@ -3215,7 +3215,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
                $notExistingDirectory = PATH_site . 'typo3temp/' . uniqid('notExists_') . '/';
-               $symlinkName = 'typo3temp/' . uniqid('link_');
+               $symlinkName = PATH_site . 'typo3temp/' . uniqid('link_');
                symlink($notExistingDirectory, $symlinkName);
                Utility\GeneralUtility::rmdir($symlinkName, TRUE);
                $this->assertFalse(is_link($symlinkName));
@@ -3229,7 +3229,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
                $notExistingFile = PATH_site . 'typo3temp/' . uniqid('notExists_');
-               $symlinkName = 'typo3temp/' . uniqid('link_');
+               $symlinkName = PATH_site . 'typo3temp/' . uniqid('link_');
                symlink($notExistingFile, $symlinkName);
                Utility\GeneralUtility::rmdir($symlinkName, TRUE);
                $this->assertFalse(is_link($symlinkName));