[TASK] Clean up unit tests on Windows 02/47502/5
authorSusanne Moog <typo3@susannemoog.de>
Sun, 3 Apr 2016 12:14:50 +0000 (14:14 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 7 Apr 2016 15:35:27 +0000 (17:35 +0200)
At the moment a lot of tests are skipped on Windows environments.
The main reasons are permissions, symlinks and shell exec commands.
As symlinks are now working on Windows (if the user / group is allowed
to create them) there is no reason to skip those tests. As you can only
create valid symlinks on Windows (the target is checked for existence)
the tests needed to be adjusted to take that into account.

Additionally some of the other tests don't need to be skipped either, as
they mock all system specific calls (e.g. AbstractNodeTests).

For the other tests the message on skipping was updated to contain more
information as to what causes them to be irrelevant on Windows.

Resolves: #75388
Releases: master
Change-Id: I86c6d9b0cec34a94d1185f46e2023af811b16107
Reviewed-on: https://review.typo3.org/47502
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php
typo3/sysext/core/Tests/Unit/Locking/SimpleLockStrategyTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php
typo3/sysext/install/Tests/Unit/FolderStructure/LinkNodeTest.php
typo3/sysext/rsaauth/Tests/Unit/Backend/CommandLineBackendTest.php

index fb84ce6..473dac6 100755 (executable)
@@ -2336,6 +2336,10 @@ class GeneralUtility
             clearstatcache();
         } elseif (is_link($path)) {
             $OK = @unlink($path);
+            if (!$OK && TYPO3_OS === 'WIN') {
+                // Try to delete dead folder links on Windows systems
+                $OK = @rmdir($path);
+            }
             clearstatcache();
         }
         return $OK;
index 2c88650..efe65c1 100644 (file)
@@ -364,8 +364,8 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         if (function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
-        } elseif (TYPO3_OS == 'WIN') {
-            $this->markTestSkipped('Not available on Windows');
+        } elseif (TYPO3_OS === 'WIN') {
+            $this->markTestSkipped('Not available on Windows as folders are always writable');
         }
         /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
         $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('dummy'));
@@ -393,8 +393,6 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     {
         if (function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
-        } elseif (TYPO3_OS == 'WIN') {
-            $this->markTestSkipped('Not available on Windows');
         }
         /** @var $subject \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
         $subject = $this->getAccessibleMock(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class, array('dummy'));
index 93bc5fe..8af81e1 100644 (file)
@@ -101,9 +101,6 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function getPathThisScriptCliAddsCurrentWorkingDirectoryFromServerEnvironmentToLocalPathOnUnix()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $GLOBALS['_SERVER']['argv'][0] = 'foo';
         $fakedAbsolutePart = '/' . $this->getUniqueId('Absolute') . '/';
         $_SERVER['PWD'] = $fakedAbsolutePart;
@@ -115,9 +112,6 @@ class SystemEnvironmentBuilderTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function getUnifiedDirectoryNameReturnsCorrectPathOnUnix()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $input = '/foo/bar/test.php';
         $expected = '/foo/bar';
         $actual = $this->subject->_call('getUnifiedDirectoryName', $input);
index 5dedcd3..e64b569 100644 (file)
@@ -103,9 +103,6 @@ class SimpleLockStrategyTest extends UnitTestCase
      */
     public function releaseDoesNotRemoveFilesNotWithinTypo3TempLocksDirectory($file)
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('releaseDoesNotRemoveFilesNotWithinTypo3TempLocksDirectory() test not available on Windows.');
-        }
         // Create test file
         touch($file);
         if (!is_file($file)) {
index 5b60fd4..dfda3d0 100644 (file)
@@ -35,6 +35,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 {
+    const NO_FIX_PERMISSIONS_ON_WINDOWS = 'fixPermissions() not available on Windows (method does nothing)';
     /**
      * @var array A backup of registered singleton instances
      */
@@ -1594,9 +1595,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function getIndpEnvTypo3SitePathReturnsStringStartingWithSlash()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
+        $_SERVER['SCRIPT_NAME'] = '/typo3/';
         $result = GeneralUtility::getIndpEnv('TYPO3_SITE_PATH');
         $this->assertEquals('/', $result[0]);
     }
@@ -2718,7 +2717,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsGroup()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissionsSetsGroup() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         if (!function_exists('posix_getegid')) {
             $this->markTestSkipped('Function posix_getegid() not available, fixPermissionsSetsGroup() tests skipped');
@@ -2743,7 +2742,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsPermissionsToFile()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test file
         $filename = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
@@ -2763,7 +2762,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsPermissionsToHiddenFile()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test file
         $filename = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
@@ -2783,7 +2782,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsPermissionsToDirectory()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test directory
         $directory = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
@@ -2803,7 +2802,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsPermissionsToDirectoryWithTrailingSlash()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test directory
         $directory = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
@@ -2824,7 +2823,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsPermissionsToHiddenDirectory()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test directory
         $directory = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
@@ -2845,7 +2844,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsCorrectlySetsPermissionsRecursive()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test directory and file structure
         $baseDirectory = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
@@ -2896,7 +2895,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsDoesNotSetPermissionsToNotAllowedPath()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Create and prepare test file
         $filename = PATH_site . 'typo3temp/var/tests/../../../typo3temp/var/tests/' . $this->getUniqueId('test_');
@@ -2912,7 +2911,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsPermissionsWithRelativeFileReference()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $filename = 'typo3temp/var/tests/' . $this->getUniqueId('test_');
         GeneralUtility::writeFileToTypo3tempDir(PATH_site . $filename, '42');
@@ -2932,7 +2931,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsDefaultPermissionsToFile()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $filename = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
         GeneralUtilityFilesystemFixture::writeFileToTypo3tempDir($filename, '42');
@@ -2950,7 +2949,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function fixPermissionsSetsDefaultPermissionsToDirectory()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('fixPermissions() tests not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $directory = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
         GeneralUtilityFilesystemFixture::mkdir($directory);
@@ -3007,7 +3006,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function mkdirSetsPermissionsOfCreatedDirectory()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('mkdirSetsPermissionsOfCreatedDirectory() test not available on Windows');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $directory = $this->getVirtualTestDir() . '/' . $this->getUniqueId('test_');
         $oldUmask = umask(19);
@@ -3048,7 +3047,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     private function checkGroups($methodName)
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped($methodName . '() test not available on Windows.');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
             return false;
         }
         if (!function_exists('posix_getegid')) {
@@ -3129,7 +3128,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function mkdirDeepFixesPermissionsOfCreatedDirectory()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('mkdirDeepFixesPermissionsOfCreatedDirectory() test not available on Windows.');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $directory = $this->getUniqueId('mkdirdeeptest_');
         $oldUmask = umask(19);
@@ -3147,7 +3146,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function mkdirDeepFixesPermissionsOnNewParentDirectory()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('mkdirDeepFixesPermissionsOnNewParentDirectory() test not available on Windows.');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $directory = $this->getUniqueId('mkdirdeeptest_');
         $subDirectory = $directory . '/bar';
@@ -3166,7 +3165,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function mkdirDeepDoesNotChangePermissionsOfExistingSubDirectories()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('mkdirDeepDoesNotChangePermissionsOfExistingSubDirectories() test not available on Windows.');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $baseDirectory = PATH_site . 'typo3temp/var/tests/';
         $existingDirectory = $this->getUniqueId('test_existing_') . '/';
@@ -3364,9 +3363,6 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function rmdirRemovesLinkToDirectory()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $existingDirectory = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('notExists_') . '/';
         mkdir($existingDirectory);
         $this->testFilesToDelete[] = $existingDirectory;
@@ -3381,12 +3377,12 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function rmdirRemovesDeadLinkToDirectory()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $notExistingDirectory = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('notExists_') . '/';
         $symlinkName = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('link_');
+        mkdir($notExistingDirectory);
         symlink($notExistingDirectory, $symlinkName);
+        rmdir($notExistingDirectory);
+
         GeneralUtility::rmdir($symlinkName, true);
         $this->assertFalse(is_link($symlinkName));
     }
@@ -3396,12 +3392,11 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function rmdirRemovesDeadLinkToFile()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $notExistingFile = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('notExists_');
         $symlinkName = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('link_');
+        touch($notExistingFile);
         symlink($notExistingFile, $symlinkName);
+        unlink($notExistingFile);
         GeneralUtility::rmdir($symlinkName, true);
         $this->assertFalse(is_link($symlinkName));
     }
@@ -4367,7 +4362,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function syslogFixesPermissionsOnFileIfUsingFileLogging()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('syslogFixesPermissionsOnFileIfUsingFileLogging() test not available on Windows.');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         // Fake all required settings
         $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLogLevel'] = 0;
@@ -4389,7 +4384,7 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     public function deprecationLogFixesPermissionsOnLogFile()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('deprecationLogFixesPermissionsOnLogFile() test not available on Windows.');
+            $this->markTestSkipped(self::NO_FIX_PERMISSIONS_ON_WINDOWS);
         }
         $filePath = PATH_site . GeneralUtilityFixture::DEPRECATION_LOG_PATH;
         @mkdir(dirname($filePath));
index de1f4c5..23eb858 100644 (file)
@@ -127,14 +127,13 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
      */
     public function existsReturnsTrueIfIsLinkAndTargetIsDead()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\AbstractNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\AbstractNode::class, array('getAbsolutePath'), array(), '', false);
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('link_');
         $target = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('notExists_');
+        touch($target);
         symlink($target, $path);
+        unlink($target);
         $this->testFilesToDelete[] = $path;
         $node->expects($this->any())->method('getAbsolutePath')->will($this->returnValue($path));
         $this->assertTrue($node->_call('exists'));
@@ -176,9 +175,6 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
      */
     public function fixPermissionReturnsNoticeStatusIfPermissionCanNotBeChanged()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         if (function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
         }
@@ -207,9 +203,6 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
      */
     public function fixPermissionReturnsNoticeStatusIfPermissionsCanNotBeChanged()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         if (function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
         }
@@ -238,9 +231,6 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
      */
     public function fixPermissionReturnsOkStatusIfPermissionCanBeFixedAndSetsPermissionToCorrectValue()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\AbstractNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(
             \TYPO3\CMS\Install\FolderStructure\AbstractNode::class,
@@ -291,9 +281,6 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
      */
     public function getCurrentPermissionReturnsCurrentDirectoryPermission()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\AbstractNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\AbstractNode::class, array('getAbsolutePath'), array(), '', false);
         $path = $this->getVirtualTestDir('dir_');
@@ -308,9 +295,6 @@ class AbstractNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTest
      */
     public function getCurrentPermissionReturnsCurrentFilePermission()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\AbstractNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\AbstractNode::class, array('getAbsolutePath'), array(), '', false);
         $file = $this->getVirtualTestFilePath('file_');
index 2691699..f7f3bd6 100644 (file)
@@ -474,9 +474,6 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
      */
     public function createDirectoryReturnsErrorStatusIfDirectoryWasNotCreated()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'), array(), '', false);
         $path = $this->getVirtualTestDir('root_');
@@ -597,9 +594,6 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
      */
     public function isWritableReturnsFalseIfNodeExistsButFileCanNotBeCreated()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         if (function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
         }
@@ -629,9 +623,6 @@ class DirectoryNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTes
      */
     public function isDirectoryReturnsFalseIfNameIsALinkToADirectory()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\DirectoryNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\DirectoryNode::class, array('getAbsolutePath'), array(), '', false);
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('root_');
index 7a2a8f9..ebdbbd3 100644 (file)
@@ -584,9 +584,6 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
      */
     public function createFileReturnsErrorStatusIfFileWasNotCreated()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('exists', 'getAbsolutePath', 'getRelativePathBelowSiteRoot'), array(), '', false);
         $path = $this->getVirtualTestDir();
@@ -741,9 +738,6 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
      */
     public function setContentReturnsErrorStatusIfContentCanNotBeSetSet()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         if (function_exists('posix_getegid') && posix_getegid() === 0) {
             $this->markTestSkipped('Test skipped if run on linux as root');
         }
@@ -778,9 +772,6 @@ class FileNodeTest extends \TYPO3\CMS\Install\Tests\Unit\FolderStructureTestCase
      */
     public function isFileReturnsFalseIfNameIsALinkFile()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\FileNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\FileNode::class, array('getAbsolutePath'), array(), '', false);
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('root_');
index 3e7dd4a..84dee7d 100644 (file)
@@ -252,15 +252,14 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function isLinkReturnsTrueIfNameIsLink()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('exists', 'getAbsolutePath'), array(), '', false);
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('link_');
-        $target = PATH_site . $this->getUniqueId('linkTarget_');
+        $target = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('linkTarget_');
+        touch($target);
         symlink($target, $path);
         $this->testFilesToDelete[] = $path;
+        $this->testFilesToDelete[] = $target;
         $node->expects($this->any())->method('exists')->will($this->returnValue(true));
         $node->expects($this->any())->method('getAbsolutePath')->will($this->returnValue($path));
         $this->assertTrue($node->_call('isLink'));
@@ -271,9 +270,6 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function isFileReturnsFalseIfNameIsAFile()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class, array('exists', 'getAbsolutePath'), array(), '', false);
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('file_');
@@ -342,13 +338,12 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function isTargetCorrectReturnsTrueIfActualTargetIsIdenticalToSpecifiedTarget()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('link_');
-        $target = $this->getUniqueId('linkTarget_');
+        $target = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('linkTarget_');
+        touch($target);
         symlink($target, $path);
         $this->testFilesToDelete[] = $path;
+        $this->testFilesToDelete[] = $target;
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class,
             array('exists', 'isLink', 'getTarget', 'getAbsolutePath'),
@@ -358,7 +353,7 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         );
         $node->expects($this->any())->method('exists')->will($this->returnValue(true));
         $node->expects($this->any())->method('isLink')->will($this->returnValue(true));
-        $node->expects($this->once())->method('getTarget')->will($this->returnValue($target));
+        $node->expects($this->once())->method('getTarget')->will($this->returnValue(str_replace('/', DIRECTORY_SEPARATOR, $target)));
         $node->expects($this->once())->method('getAbsolutePath')->will($this->returnValue($path));
         $this->assertTrue($node->_call('isTargetCorrect'));
     }
@@ -369,13 +364,12 @@ class LinkNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
      */
     public function isTargetCorrectReturnsFalseIfActualTargetIsNotIdenticalToSpecifiedTarget()
     {
-        if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('Test not available on Windows OS.');
-        }
         $path = PATH_site . 'typo3temp/var/tests/' . $this->getUniqueId('link_');
-        $target = $this->getUniqueId('linkTarget_');
+        $target = PATH_site . 'typo3temp/var/tests/' .$this->getUniqueId('linkTarget_');
+        touch($target);
         symlink($target, $path);
         $this->testFilesToDelete[] = $path;
+        $this->testFilesToDelete[] = $target;
         /** @var $node \TYPO3\CMS\Install\FolderStructure\LinkNode|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
         $node = $this->getAccessibleMock(\TYPO3\CMS\Install\FolderStructure\LinkNode::class,
             array('exists', 'isLink', 'getTarget', 'getAbsolutePath'),
index de3170d..e15b4ca 100644 (file)
@@ -29,7 +29,7 @@ class CommandLineBackendTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
     protected function setUp()
     {
         if (TYPO3_OS === 'WIN') {
-            $this->markTestSkipped('This test is not available on Windows.');
+            $this->markTestSkipped('This test is not available on Windows as auto-detection of openssl path will fail.');
         }
 
         $this->subject = new CommandLineBackend();