TYPO3  7.6
AbstractImportTestCase.php
Go to the documentation of this file.
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 
18 
22 abstract class AbstractImportTestCase extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
23 {
27  protected $coreExtensionsToLoad = array('impexp');
28 
32  protected $import;
33 
40  protected $testFilesToDelete = array();
41 
47  protected function setUp()
48  {
49  parent::setUp();
50 
51  $this->import = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\ImportExport::class);
52  $this->import->init(0, 'import');
53  }
54 
58  protected function tearDown()
59  {
60  foreach ($this->testFilesToDelete as $absoluteFileName) {
61  if (@is_file($absoluteFileName)) {
62  unlink($absoluteFileName);
63  }
64  }
65  parent::tearDown();
66  }
67 
73  protected function isCaseSensitiveFilesystem()
74  {
75  $caseSensitive = true;
76  $path = GeneralUtility::tempnam('aAbB');
77 
78  // do the actual sensitivity check
79  if (@file_exists(strtoupper($path)) && @file_exists(strtolower($path))) {
80  $caseSensitive = false;
81  }
82 
83  // clean filesystem
84  unlink($path);
85  return $caseSensitive;
86  }
87 }