[TASK] Allow rector to process tests 83/62583/4
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Mon, 9 Dec 2019 15:35:45 +0000 (16:35 +0100)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 10 Dec 2019 08:55:00 +0000 (09:55 +0100)
In order to let rector process tests, the autoloading
of all processed classes needs to be intact.

In TYPO3 there were a bunch of classes whose namespace
were a bit wrong according to PSR-4 and there were some
class that didn't fit the PSR-4 standard at all.

Classes that could easily be fixed have been fixed.
All others have either been registered via a class map
in composer.json or they have been excluded from the
processing of rector.

This change does not apply rector rules to tests,
it only enables rector to operate on tests due to
fixed autoloading.

Releases: master
Resolves: #89900
Change-Id: Iaa4a5bb2677a5a9af374d780423d962dcc09ade2
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62583
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
15 files changed:
composer.json
rector.yml
typo3/sysext/core/Tests/Functional/Session/SessionManagerTest.php
typo3/sysext/core/Tests/Unit/Configuration/Parser/PageTsConfigParserTest.php
typo3/sysext/core/Tests/Unit/Pagination/ArrayPaginatorTest.php
typo3/sysext/core/Tests/Unit/Pagination/SimplePaginationTest.php
typo3/sysext/core/Tests/Unit/Routing/Aspect/AspectFactoryTest.php
typo3/sysext/core/Tests/Unit/TypoScript/Parser/ConstantConfigurationParserTest.php
typo3/sysext/core/composer.json
typo3/sysext/extbase/composer.json
typo3/sysext/felogin/Tests/Unit/Redirect/RedirectHandlerTest.php
typo3/sysext/fluid/composer.json
typo3/sysext/frontend/Tests/Functional/Imaging/GifBuilderTest.php
typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Fixtures/CodeStatisticsFixture.php
typo3/sysext/redirects/Tests/Functional/Service/SlugServiceTest.php

index ce6967f..9c38de4 100644 (file)
                        "TYPO3\\CMS\\T3editor\\Tests\\": "typo3/sysext/t3editor/Tests/"
                },
                "classmap": [
+                       "typo3/sysext/core/Tests/Unit/Core/Fixtures/test_extension/",
                        "typo3/sysext/core/Tests/Functional/Fixtures/",
                        "typo3/sysext/extbase/Tests/Unit/Object/Container/Fixtures/",
-                       "typo3/sysext/extbase/Tests/Functional/Fixtures/"
+                       "typo3/sysext/extbase/Tests/Functional/Fixtures/",
+                       "typo3/sysext/fluid/Tests/Functional/Fixtures/Extensions/fluid_test/Classes/"
+               ],
+               "files": [
+                       "typo3/sysext/extbase/Tests/Fixture/TxClassWithGettersAndSetters.php"
                ]
        }
 }
index 322a93c..25e99b0 100644 (file)
@@ -11,6 +11,16 @@ parameters:
   auto_import_names: false
   paths:
     - 'typo3/sysext/*/Classes/'
+    - 'typo3/sysext/*/Tests/Unit/'
+    - 'typo3/sysext/*/Tests/Functional/'
+  exclude_paths:
+      - 'typo3/sysext/*/Configuration/'
+      - 'typo3/sysext/core/Tests/Unit/Configuration/TypoScript/ConditionMatching/Fixtures/ConditionMatcherUserFuncs.php'
+      - 'typo3/sysext/*/Tests/Unit/Acceptance'
+      - 'typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ClassNameMatcherFixture.php'
+      - 'typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/PropertyExistsStaticMatcherFixture.php'
+      - 'ClassAliasMap.php'
+      - 'class.ext_update.php'
   sets:
     - 'php53'
     - 'php54'
index 2d663b6..5de40de 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 declare(strict_types = 1);
-namespace TYPO3\CMS\Core\Tests\Functional\Service;
+namespace TYPO3\CMS\Core\Tests\Functional\Session;
 
 /*
  * This file is part of the TYPO3 CMS project.
index e650881..e73e540 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 declare(strict_types = 1);
-namespace TYPO3\CMS\Core\Tests\Unit\Configuration\Loader;
+namespace TYPO3\CMS\Core\Tests\Unit\Configuration\Parser;
 
 /*
  * This file is part of the TYPO3 CMS project.
index 9c0f9ec..5fc2bfb 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 declare(strict_types = 1);
 
-namespace TYPO3\CMS\Extbase\Tests\Unit\Pagination;
+namespace TYPO3\CMS\Core\Tests\Unit\Pagination;
 
 /*
  * This file is part of the TYPO3 CMS project.
index dfe5de8..1bbe97e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 declare(strict_types = 1);
 
-namespace TYPO3\CMS\Extbase\Tests\Unit\Pagination;
+namespace TYPO3\CMS\Core\Tests\Unit\Pagination;
 
 /*
  * This file is part of the TYPO3 CMS project.
index 5c9e121..9258394 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 declare(strict_types = 1);
 
-namespace TYPO3\CMS\Core\Tests\Unit\Routing\Enhancer;
+namespace TYPO3\CMS\Core\Tests\Unit\Routing\Aspect;
 
 /*
  * This file is part of the TYPO3 CMS project.
index 03ef350..66bb613 100644 (file)
@@ -1,10 +1,11 @@
 <?php
 declare(strict_types = 1);
 
-namespace TYPO3\CMS\Core\TypoScript\Parser;
+namespace TYPO3\CMS\Core\Tests\Unit\TypoScript\Parser;
 
 use TYPO3\CMS\Core\Core\ApplicationContext;
 use TYPO3\CMS\Core\Core\Environment;
+use TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 class ConstantConfigurationParserTest extends UnitTestCase
index b6a2b70..c19e577 100644 (file)
        "autoload-dev": {
                "psr-4": {
                        "TYPO3\\CMS\\Core\\Tests\\": "Tests/"
-               }
+               },
+               "classmap": [
+                       "Tests/Unit/Core/Fixtures/test_extension/",
+                       "Tests/Functional/Fixtures/"
+               ]
        }
 }
index f0d46d5..df797c6 100644 (file)
@@ -53,6 +53,9 @@
                "classmap": [
                        "Tests/Unit/Object/Container/Fixtures/",
                        "Tests/Functional/Fixtures/"
+               ],
+               "files": [
+                       "Tests/Fixture/TxClassWithGettersAndSetters.php"
                ]
        }
 }
index a13b1b0..d55bbe7 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 declare(strict_types = 1);
 
-namespace TYPO3\CMS\FrontendLogin\Tests\Unit\Controller;
+namespace TYPO3\CMS\FrontendLogin\Tests\Unit\Redirect;
 
 /*
  * This file is part of the TYPO3 CMS project.
index 33df79e..aca0ca6 100644 (file)
@@ -42,6 +42,9 @@
        "autoload-dev": {
                "psr-4": {
                        "TYPO3\\CMS\\Fluid\\Tests\\": "Tests/"
-               }
+               },
+               "classmap": [
+                       "Tests/Functional/Fixtures/Extensions/fluid_test/Classes/"
+               ]
        }
 }
index e7d5f89..e434a11 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 declare(strict_types = 1);
-namespace TYPO3\CMS\Frontend\Tests\Functional\ContentObject;
+namespace TYPO3\CMS\Frontend\Tests\Functional\Imaging;
 
 /*
  * This file is part of the TYPO3 CMS project.
index 9917dbc..b2d49a6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Tests\Unit\CodeScanner\Php\Fixtures;
+namespace TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Fixtures;
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
index a881a6e..ec58e49 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 declare(strict_types = 1);
-namespace TYPO3\CMS\Core\Tests\Functional\Domain\Repository;
+namespace TYPO3\CMS\Redirects\Tests\Functional\Service;
 
 /*
  * This file is part of the TYPO3 CMS project.