[CLEANUP] Remove obsolete require_once from test files
[Packages/TYPO3.CMS.git] / typo3 / sysext / impexp / Tests / Functional / Import / AbstractImportTestCase.php
1 <?php
2 namespace TYPO3\CMS\Impexp\Tests\Functional\Import;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Utility\GeneralUtility;
18
19 /**
20 * Functional test for the ImportExport
21 */
22 abstract class AbstractImportTestCase extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase {
23
24 /**
25 * @var array
26 */
27 protected $coreExtensionsToLoad = array('impexp');
28
29 /**
30 * @var \TYPO3\CMS\Impexp\ImportExport
31 */
32 protected $import;
33
34 /**
35 * Absolute path to files that must be removed
36 * after a test - handled in tearDown
37 *
38 * @var array
39 */
40 protected $testFilesToDelete = array();
41
42 /**
43 * Set up for initialization of the ImportExport instance
44 *
45 * @return void
46 */
47 protected function setUp() {
48 parent::setUp();
49
50 $this->import = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\ImportExport::class);
51 $this->import->init(0, 'import');
52 }
53
54 /**
55 * Tear down for remove of the test files
56 */
57 protected function tearDown() {
58 foreach ($this->testFilesToDelete as $absoluteFileName) {
59 if (@is_file($absoluteFileName)) {
60 unlink($absoluteFileName);
61 }
62 }
63 parent::tearDown();
64 }
65
66 /**
67 * Test if the local filesystem is case sensitive
68 *
69 * @return bool
70 */
71 protected function isCaseSensitiveFilesystem() {
72 $caseSensitive = TRUE;
73 $path = GeneralUtility::tempnam('aAbB');
74
75 // do the actual sensitivity check
76 if (@file_exists(strtoupper($path)) && @file_exists(strtolower($path))) {
77 $caseSensitive = FALSE;
78 }
79
80 // clean filesystem
81 unlink($path);
82 return $caseSensitive;
83 }
84
85 }