[TASK] Cleanup require and require_once
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 14 Apr 2013 00:18:58 +0000 (02:18 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 14 Apr 2013 10:06:27 +0000 (12:06 +0200)
* Use DIR instead of dirname(FILE) (since TYPO3 5.3.0)
* Use DIR for refering to relative paths
  to make sure the correct file is included (no search in path)

Resolves: #47205
Releases: 6.1
Change-Id: I0b78e056bfc6c281a7d1aae5928345d653e93d6d
Reviewed-on: https://review.typo3.org/19954
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
23 files changed:
typo3/sysext/extbase/Tests/Functional/Domain/Model/FileContextTest.php
typo3/sysext/extbase/Tests/Unit/Property/MapperTest.php
typo3/sysext/extbase/Tests/Unit/Property/PropertyMapperTest.php
typo3/sysext/extbase/Tests/Unit/Property/PropertyMappingConfigurationBuilderTest.php
typo3/sysext/extbase/Tests/Unit/Property/PropertyMappingConfigurationTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
typo3/sysext/extbase/Tests/Unit/Reflection/ObjectAccessTest.php
typo3/sysext/extbase/Tests/Unit/Scheduler/FieldProviderTest.php
typo3/sysext/extbase/Tests/Unit/Scheduler/TaskExecuterTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/AlphanumericValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/BooleanValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/EmailAddressValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/FloatValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/GenericObjectValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/IntegerValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/NotEmptyValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/NumberRangeValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/NumberValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/RawValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/RegularExpressionValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/StringLengthValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/StringValidatorTest.php
typo3/sysext/extbase/Tests/Unit/Validation/Validator/TextValidatorTest.php

index a0e440d..28e5f73 100644 (file)
@@ -46,10 +46,10 @@ class FileContextTest extends \Tx_Extbase_Tests_Functional_BaseTestCase {
        protected function setUp() {
                $this->markTestIncomplete('Functional tests do not work yet.');
                parent::setUp();
-               $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file_storage.xml');
-               $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file.xml');
-               $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file_reference.xml');
-               $this->importDataSet(dirname(__FILE__) . '/Fixture/data_sys_file_collection.xml');
+               $this->importDataSet(__DIR__ . '/Fixture/data_sys_file_storage.xml');
+               $this->importDataSet(__DIR__ . '/Fixture/data_sys_file.xml');
+               $this->importDataSet(__DIR__ . '/Fixture/data_sys_file_reference.xml');
+               $this->importDataSet(__DIR__ . '/Fixture/data_sys_file_collection.xml');
                /** @var $configurationBuilder \TYPO3\CMS\Extbase\Property\PropertyMappingConfigurationBuilder */
                $configurationBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Property\\PropertyMappingConfigurationBuilder');
                $this->propertyMapperConfiguration = $configurationBuilder->build('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\MvcPropertyMappingConfiguration');
index 555f0df..425dd66 100644 (file)
@@ -21,7 +21,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Property;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-require_once(__DIR__ . '/../../Fixture/TxClassWithGettersAndSetters.php');
+require_once __DIR__ . '/../../Fixture/TxClassWithGettersAndSetters.php';
 
 /**
  * Testcase for the Property Mapper
index 56ea25a..886bc46 100644 (file)
@@ -21,7 +21,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Property;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-require_once (__DIR__ . '/../../Fixture/ClassWithSetters.php');
+require_once __DIR__ . '/../../Fixture/ClassWithSetters.php';
 
 /**
  * Testcase for the Property Mapper
index 63437ca..59c5caf 100644 (file)
@@ -21,7 +21,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Property;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-require_once (__DIR__ . '/../../Fixture/ClassWithSetters.php');
+require_once __DIR__ . '/../../Fixture/ClassWithSetters.php';
 
 /**
  * Testcase for the Property Mapper
index d614c9c..5f9dece 100644 (file)
@@ -21,7 +21,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Property;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-require_once (__DIR__ . '/../../Fixture/ClassWithSetters.php');
+require_once __DIR__ . '/../../Fixture/ClassWithSetters.php';
 
 /**
  * Testcase for the Property Mapper
index f6095fb..6d7cccd 100644 (file)
@@ -21,8 +21,8 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Property\TypeConverter;
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
-require_once (__DIR__ . '/../../../Fixture/ClassWithSetters.php');
-require_once (__DIR__ . '/../../../Fixture/ClassWithSettersAndConstructor.php');
+require_once __DIR__ . '/../../../Fixture/ClassWithSetters.php';
+require_once __DIR__ . '/../../../Fixture/ClassWithSettersAndConstructor.php';
 
 /**
  * Testcase for the PersistentObjectConverter
index 4581db7..4ca7bed 100644 (file)
@@ -25,8 +25,8 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Reflection;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-require_once 'Fixture/DummyClassWithGettersAndSetters.php';
-require_once 'Fixture/ArrayAccessClass.php';
+require_once __DIR__ . '/Fixture/DummyClassWithGettersAndSetters.php';
+require_once __DIR__ . '/Fixture/ArrayAccessClass.php';
 
 /**
  * Test Unit Test Base Class
index ededf10..ee15006 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 namespace TYPO3\CMS\Extbase\Tests\Unit\Scheduler;
 
-require_once (__DIR__ . '/Fixtures/MockACommandController.php');
-require_once (__DIR__ . '/Fixtures/MockBCommandController.php');
-require_once (__DIR__ . '/Fixtures/MockCCommandController.php');
+require_once __DIR__ . '/Fixtures/MockACommandController.php';
+require_once __DIR__ . '/Fixtures/MockBCommandController.php';
+require_once __DIR__ . '/Fixtures/MockCCommandController.php';
 
 /***************************************************************
  *  Copyright notice
index 6f07abb..b0febc1 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace TYPO3\CMS\Extbase\Tests\Unit\Scheduler;
 
-require_once (__DIR__ . '/Fixtures/MockACommandController.php');
+require_once __DIR__ . '/Fixtures/MockACommandController.php';
 
 /***************************************************************
  *  Copyright notice
index a0b3317..ab46fff 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the alphanumeric validator
index 03bd03b..dc08a01 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the number range validator
index 2770bd5..dd13912 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the email address validator
index ff05c7f..1a56f8e 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the float validator
index 3aa8ec7..c3c7fc8 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the Generic Object Validator
index e99b61a..90316bb 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the integer validator
index 886e99c..871469d 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the not empty validator
index 0a21570..56e2936 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the number range validator
index b4937b8..90d6aaa 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the number validator
index 002fe34..557f2d5 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the raw validator
index 6508158..16a35c7 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the regular expression validator
index 37cb632..c25fdad 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the string length validator
index 30946fe..6fe67d9 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the string length validator
index bf3b6f0..0686675 100644 (file)
@@ -20,7 +20,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator;
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
-require_once 'AbstractValidatorTestcase.php';
+require_once __DIR__ . '/AbstractValidatorTestcase.php';
 
 /**
  * Testcase for the text validator