Skip to content

Commit

Permalink
[Tests] Remove RunTestsInSeparateProcesses take 2 (#3668)
Browse files Browse the repository at this point in the history
* [Tests] Remove RunTestsInSeparateProcesses take 2

* config path

* clean up

* final touch: rename path
  • Loading branch information
samsonasik committed Apr 23, 2023
1 parent 7bcda1e commit b11c28e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;

#[RunTestsInSeparateProcesses]
final class RenameClassRectorTest extends AbstractRectorTestCase
{
#[DataProvider('provideData')]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\Renaming\Rector\Name\RenameClassRector;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use Rector\Testing\PHPUnit\AbstractRectorTestCase;

final class RenameIncludingNamespaceWithDocblockTest extends AbstractRectorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
{
$this->doTestFile($filePath);
}

public static function provideData(): Iterator
{
return self::yieldFilesFromDirectory(__DIR__ . '/FixtureIncludingNamespaceWithDocblock');
}

public function provideConfigFilePath(): string
{
return __DIR__ . '/config/configured_rule_rename_including_namespace_with_docblock.php';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Renaming\Rector\Name\RenameClassRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->removeUnusedImports();

$rectorConfig
->ruleWithConfiguration(RenameClassRector::class, [
'MyNamespace\MylegacyClass' => 'MyNewNamespace\MyNewClass',
]);
};

0 comments on commit b11c28e

Please sign in to comment.