Skip to content

Commit

Permalink
[TASK] Move tests classes into the correct namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi committed Oct 15, 2024
1 parent a119179 commit f42022d
Show file tree
Hide file tree
Showing 47 changed files with 45 additions and 48 deletions.
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'*/Source/*',
'*/Source*',
'*/Expected/*',
__DIR__ . '/tests/Rector/CodeQuality/Rector/General/',
__DIR__ . '/tests/Rector/CodeQuality/General/',
])
->withSets([
LevelSetList::UP_TO_PHP_74,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\ConvertImplicitVariablesToExplicitGlobalsRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\ConvertImplicitVariablesToExplicitGlobalsRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Ssch\TYPO3Rector\CodeQuality\General\ConvertImplicitVariablesToExplicitGlobalsRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');

$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->rule(ConvertImplicitVariablesToExplicitGlobalsRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\ExtEmConfRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\ExtEmConfRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\General\ExtEmConfRector\Fixture;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\ExtEmConfRector\Fixture;

$EM_CONF = [];
$_EXTKEY = 'foo';
Expand Down Expand Up @@ -47,7 +47,7 @@ $EM_CONF[$_EXTKEY] = [
-----
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\General\ExtEmConfRector\Fixture;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\ExtEmConfRector\Fixture;

$EM_CONF = [];
$_EXTKEY = 'foo';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Ssch\TYPO3Rector\CodeQuality\General\ExtEmConfRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig
->ruleWithConfiguration(ExtEmConfRector::class, [
ExtEmConfRector::PHP_VERSION_CONSTRAINT => '7.4.0-8.1.99',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\InjectMethodToConstructorInjectionRector\Fixture;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\InjectMethodToConstructorInjectionRector\Fixture;

use TYPO3\CMS\Core\Cache\CacheManager;

Expand All @@ -17,7 +17,7 @@ class Service
-----
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\InjectMethodToConstructorInjectionRector\Fixture;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\InjectMethodToConstructorInjectionRector\Fixture;

use TYPO3\CMS\Core\Cache\CacheManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\InjectMethodToConstructorInjectionRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\InjectMethodToConstructorInjectionRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
use Ssch\TYPO3Rector\CodeQuality\General\InjectMethodToConstructorInjectionRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->rule(InjectMethodToConstructorInjectionRector::class);
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\General\MethodGetInstanceToMakeInstanceCallRector\Fixture;

use Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MethodGetInstanceToMakeInstanceCallRector\Source\MySourceClass;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector\Fixture;

$instance = \TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::getInstance();
$instance = \TYPO3\CMS\Core\Resource\Index\FileIndexRepository::getInstance();
Expand All @@ -13,13 +11,13 @@ $instance = \TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry::getIn
$instance = \TYPO3\CMS\Form\Service\TranslationService::getInstance();
$instance = \TYPO3\CMS\T3editor\Registry\AddonRegistry::getInstance();
$instance = \TYPO3\CMS\T3editor\Registry\ModeRegistry::getInstance();
$instance = MySourceClass::getInstance();
$instance = \Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector\Source\MySourceClass::getInstance();

?>
-----
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\General\MethodGetInstanceToMakeInstanceCallRector\Fixture;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector\Fixture;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Resource\Index\ExtractorRegistry;
Expand All @@ -31,7 +29,7 @@ use TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry;
use TYPO3\CMS\Form\Service\TranslationService;
use TYPO3\CMS\T3editor\Registry\AddonRegistry;
use TYPO3\CMS\T3editor\Registry\ModeRegistry;
use Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MethodGetInstanceToMakeInstanceCallRector\Source\MySourceClass;
use Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector\Source\MySourceClass;

$instance = GeneralUtility::makeInstance(ExtractorRegistry::class);
$instance = GeneralUtility::makeInstance(FileIndexRepository::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MethodGetInstanceToMakeInstanceCallRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MethodGetInstanceToMakeInstanceCallRector\Source;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector\Source;

final class MySourceClass
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Ssch\TYPO3Rector\CodeQuality\General\MethodGetInstanceToMakeInstanceCallRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig
->ruleWithConfiguration(MethodGetInstanceToMakeInstanceCallRector::class, [
'TYPO3\CMS\Core\Resource\Index\ExtractorRegistry',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
use Ssch\TYPO3Rector\CodeQuality\General\MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->rule(MoveExtensionManagementUtilityAddStaticFileIntoTCAOverridesRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MoveExtensionManagementUtilityAddToAllTCAtypesIntoTCAOverridesRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MoveExtensionManagementUtilityAddToAllTCAtypesIntoTCAOverridesRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
use Ssch\TYPO3Rector\CodeQuality\General\MoveExtensionManagementUtilityAddToAllTCAtypesIntoTCAOverridesRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->rule(MoveExtensionManagementUtilityAddToAllTCAtypesIntoTCAOverridesRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\MoveExtensionUtilityRegisterPluginIntoTCAOverridesRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\MoveExtensionUtilityRegisterPluginIntoTCAOverridesRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
use Ssch\TYPO3Rector\CodeQuality\General\MoveExtensionUtilityRegisterPluginIntoTCAOverridesRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->rule(MoveExtensionUtilityRegisterPluginIntoTCAOverridesRector::class);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\RenameClassMapAliasRector\Fixture;

use TYPO3\CMS\Core\Utility\GeneralUtility;

$arrayBrowser = GeneralUtility::makeInstance(\TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::class);
Expand All @@ -8,6 +10,8 @@ $arrayBrowser = GeneralUtility::makeInstance(\TYPO3\CMS\Lowlevel\Utility\ArrayBr
-----
<?php

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\RenameClassMapAliasRector\Fixture;

use TYPO3\CMS\Backend\View\ArrayBrowser;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\RenameClassMapAliasRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\RenameClassMapAliasRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Ssch\TYPO3Rector\CodeQuality\General\RenameClassMapAliasRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->importNames();
$rectorConfig->ruleWithConfiguration(RenameClassMapAliasRector::class, [
__DIR__ . '/../../../../../../Migrations/TYPO3/10.4/typo3/sysext/backend/Migrations/Code/ClassAliasMap.php',
]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\Rector\General\UseExtensionKeyInLocalizationUtilityRector;
namespace Ssch\TYPO3Rector\Tests\Rector\CodeQuality\General\UseExtensionKeyInLocalizationUtilityRector;

use Iterator;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
use Ssch\TYPO3Rector\CodeQuality\General\UseExtensionKeyInLocalizationUtilityRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../../../config/config_test.php');
$rectorConfig->import(__DIR__ . '/../../../../../../config/config_test.php');
$rectorConfig->rule(UseExtensionKeyInLocalizationUtilityRector::class);
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Ssch\TYPO3Rector\Tests\Rector\General\Renaming\RenameAttributeRector\Fixture;


use TYPO3\CMS\Backend\Attribute\AsController;
use TYPO3\CMS\Backend\Attribute\Controller;

Expand All @@ -19,7 +18,6 @@ class MyClass

namespace Ssch\TYPO3Rector\Tests\Rector\General\Renaming\RenameAttributeRector\Fixture;


use TYPO3\CMS\Backend\Attribute\AsController;
use TYPO3\CMS\Backend\Attribute\Controller;

Expand Down

0 comments on commit f42022d

Please sign in to comment.