[BUGFIX] Failing Unit Tests on Windows systems 02/46602/2
authorNicole Cordes <typo3@cordes.co>
Fri, 29 Jan 2016 11:56:23 +0000 (12:56 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 11 Feb 2016 21:58:53 +0000 (22:58 +0100)
Due to realpath usage some Unit Tests are failing on Windows systems.
The tests have to ensure that forward slashes are used for comparison.

Resolves: #73006
Releases: master, 7.6, 6.2
Change-Id: Iee64ab873d519fee07c6b69e63de1f7d645c071b
Reviewed-on: https://review.typo3.org/46602
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Tests/Unit/Cache/Backend/FileBackendTest.php

index 4d48efc..da534f8 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend;
 
 use org\bovigo\vfs\vfsStreamDirectory;
 use org\bovigo\vfs\vfsStreamWrapper;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Testcase for the File cache backend
@@ -84,7 +85,7 @@ class FileBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $backend->_set('cacheIdentifier', 'test');
         $backend->setCacheDirectory('tmp/foo');
         // get PATH_site without trailing slash
-        $path = realpath(PATH_site);
+        $path = GeneralUtility::fixWindowsFilePath(realpath(PATH_site));
         $this->assertEquals($path . '/tmp/foo/test/', $backend->_get('temporaryCacheDirectory'));
     }
 
@@ -97,7 +98,7 @@ class FileBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $backend->_set('cacheIdentifier', 'test');
         $backend->setCacheDirectory('tmp/foo/');
         // get PATH_site without trailing slash
-        $path = realpath(PATH_site);
+        $path = GeneralUtility::fixWindowsFilePath(realpath(PATH_site));
         $this->assertEquals($path . '/tmp/foo/test/', $backend->_get('temporaryCacheDirectory'));
     }
 
@@ -110,7 +111,7 @@ class FileBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $backend->_set('cacheIdentifier', 'test');
         $backend->setCacheDirectory('../tmp/foo');
         // get PATH_site without trailing slash
-        $path = realpath(PATH_site);
+        $path = GeneralUtility::fixWindowsFilePath(realpath(PATH_site));
         $this->assertEquals($path . '/../tmp/foo/test/', $backend->_get('temporaryCacheDirectory'));
     }
 
@@ -123,7 +124,7 @@ class FileBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $backend->_set('cacheIdentifier', 'test');
         $backend->setCacheDirectory('../tmp/foo/');
         // get PATH_site without trailing slash
-        $path = realpath(PATH_site);
+        $path = GeneralUtility::fixWindowsFilePath(realpath(PATH_site));
         $this->assertEquals($path . '/../tmp/foo/test/', $backend->_get('temporaryCacheDirectory'));
     }