[BUGFIX] Use filename with extension for copy to temp test 48/57748/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Fri, 6 Jul 2018 17:25:10 +0000 (19:25 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 31 Jul 2018 18:21:35 +0000 (20:21 +0200)
Since the extension will be added to the temporary file name there
will be an error in Windows if the file name has no extension.
Windows will not create files with a name ending with a dot.

Resolves: #85502
Releases: master, 8.7
Change-Id: I45beb47525681fff314c17f943d77cec55df35c0
Reviewed-on: https://review.typo3.org/57748
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php

index 24481d5..b6900a8 100644 (file)
@@ -945,11 +945,11 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase
         $fileContents = 'asdfgh';
         $this->addToMount([
             'someDir' => [
-                'someFile' => $fileContents
+                'someFile.ext' => $fileContents
             ]
         ]);
         $subject = $this->createDriver();
-        $filePath = GeneralUtility::fixWindowsFilePath($subject->_call('copyFileToTemporaryPath', '/someDir/someFile'));
+        $filePath = GeneralUtility::fixWindowsFilePath($subject->_call('copyFileToTemporaryPath', '/someDir/someFile.ext'));
         $this->testFilesToDelete[] = $filePath;
         $this->assertContains('/typo3temp/var/transient/', $filePath);
         $this->assertEquals($fileContents, file_get_contents($filePath));