Commit 7a0fc691 authored by Anja Leichsenring's avatar Anja Leichsenring Committed by Christian Kuhn
Browse files

[BUGFIX] Fix failing test caused by vfs removal

With #74882 usage of vfs was reduced in unit tests, revealing
side effects when tests relied on each other to create
files or folders. Now they need to take care on their own
and clean up behind.
This is one of the missed cases where a test still relied on
a test directory being created.

The test now creates and removes the required assets themself.

Resolves: #97801
Related: #97742
Releases: main
Change-Id: I55611415b89e6b43431cbc8eec2264608c6dfc75
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74970

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 37cd2b25
...@@ -2709,8 +2709,9 @@ class GeneralUtilityTest extends UnitTestCase ...@@ -2709,8 +2709,9 @@ class GeneralUtilityTest extends UnitTestCase
*/ */
public function rmdirRemovesDeadLinkToFile(): void public function rmdirRemovesDeadLinkToFile(): void
{ {
$notExistingFile = Environment::getVarPath() . '/tests/' . StringUtility::getUniqueId('notExists_'); $testDirectory = $this->getTestDirectory() . '/';
$symlinkName = Environment::getVarPath() . '/tests/' . StringUtility::getUniqueId('link_'); $notExistingFile = $testDirectory . StringUtility::getUniqueId('notExists_');
$symlinkName = $testDirectory . StringUtility::getUniqueId('link_');
touch($notExistingFile); touch($notExistingFile);
symlink($notExistingFile, $symlinkName); symlink($notExistingFile, $symlinkName);
unlink($notExistingFile); unlink($notExistingFile);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment