Commit d7b75d73 authored by Nicole Cordes's avatar Nicole Cordes
Browse files

[BUGFIX] Prevent temp file generation in Unit Test

Running Unit Tests creates file /tmp/typo3.log. On Windows systems
this file is stored on the root of the drive. This patch uses the
defined temp folder for storing the file.

Resolves: #76070
Releases: master, 7.6, 6.2
Change-Id: Id77684e41020feb1a1ecff5051a80d2919250bf8
Reviewed-on: https://review.typo3.org/48027

Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarSusanne Moog <typo3@susannemoog.de>
Tested-by: default avatarSusanne Moog <typo3@susannemoog.de>
parent 61b87af5
......@@ -96,8 +96,9 @@ class FileWriterTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
public function setLogFileAcceptsAbsolutePath()
{
$writer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\Writer\FileWriter::class);
$writer->setLogFile('/tmp/typo3.log');
$this->assertAttributeEquals('/tmp/typo3.log', 'logFile', $writer);
$tempFile = rtrim(sys_get_temp_dir(), '/\\') . '/typo3.log';
$writer->setLogFile($tempFile);
$this->assertAttributeEquals($tempFile, 'logFile', $writer);
}
/**
......
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