33 'not within PATH_site' => array(
'/tmp/TYPO3-DataSubmissionControllerTest'),
34 'does not start with upload_temp_' => array(PATH_site .
'typo3temp/foo'),
35 'directory traversal' => array(PATH_site .
'typo3temp/../typo3temp/upload_temp_foo'),
44 if (TYPO3_OS ===
'WIN') {
45 $this->markTestSkipped(
'destructorDoesNotRemoveFilesNotWithinTypo3TempDirectory() test not available on Windows.');
50 if (!is_file($file)) {
51 $this->markTestSkipped(
'destructorDoesNotRemoveFilesNotWithinTypo3TempDirectory() skipped: Test file could not be created');
54 $instance = new \TYPO3\CMS\Frontend\Controller\DataSubmissionController(999999999, $lockMethod);
55 $t3libLockReflection = new \ReflectionClass(
'TYPO3\\CMS\\Frontend\\Controller\\DataSubmissionController');
56 $t3libLockReflectionResourceProperty = $t3libLockReflection->getProperty(
'temporaryFiles');
57 $t3libLockReflectionResourceProperty->setAccessible(TRUE);
58 $t3libLockReflectionResourceProperty->setValue($instance, array($file));
61 $instance->__destruct();
64 $fileExists = is_file($file);
69 $this->assertTrue($fileExists);
destructorDoesNotRemoveFilesNotWithinTypo3TempDirectory($file)