mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 17:00:51 +00:00
remove old test
This commit is contained in:
parent
bd0104d6c6
commit
c71f34afbe
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Tests\Issues\AliasedImportDouble;
|
||||
|
||||
use Iterator;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
|
||||
/**
|
||||
* @see https://github.com/rectorphp/rector-src/pull/478/checks?check_run_id=3124352071
|
||||
*/
|
||||
final class AliasedImportDoubleTest extends AbstractRectorTestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provideData()
|
||||
*/
|
||||
public function test(SmartFileInfo $fileInfo): void
|
||||
{
|
||||
$this->doTestFileInfo($fileInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Iterator<SmartFileInfo>
|
||||
*/
|
||||
public function provideData(): Iterator
|
||||
{
|
||||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
|
||||
}
|
||||
|
||||
public function provideConfigFilePath(): string
|
||||
{
|
||||
return __DIR__ . '/config/configured_rule.php';
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Issues\AliasedImportDouble\Fixture;
|
||||
|
||||
final class Anything
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\Core\Tests\Issues\AliasedImportDouble\Fixture;
|
||||
|
||||
use TYPO3\CMS\Extbase\Annotation as Extbase;
|
||||
final class Anything
|
||||
{
|
||||
public function go()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rector\Core\Tests\Issues\AliasedImportDouble\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\PostRector\Collector\UseNodesToAddCollector;
|
||||
use Rector\StaticTypeMapper\ValueObject\Type\AliasedObjectType;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
|
||||
final class AddAliasImportRector extends AbstractRector
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UseNodesToAddCollector $useNodesToAddCollector
|
||||
) {
|
||||
}
|
||||
|
||||
public function getRuleDefinition(): RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('demo', []);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<class-string<Node>>
|
||||
*/
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
return [ClassMethod::class];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ClassMethod $node
|
||||
*/
|
||||
public function refactor(Node $node): ClassMethod
|
||||
{
|
||||
$node->name = new Identifier('go');
|
||||
|
||||
$this->useNodesToAddCollector->addUseImport(
|
||||
new AliasedObjectType('Extbase', 'TYPO3\CMS\Extbase\Annotation')
|
||||
);
|
||||
|
||||
return $node;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\Tests\Issues\AliasedImportDouble\Rector\ClassMethod\AddAliasImportRector;
|
||||
|
||||
return static function (RectorConfig $rectorConfig): void {
|
||||
$rectorConfig->rule(AddAliasImportRector::class);
|
||||
};
|
Loading…
Reference in New Issue
Block a user