Skip to content

Commit

Permalink
Merge autoImport() tests (#4050)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba authored Jun 2, 2023
1 parent 88eed98 commit 6dd57a9
Show file tree
Hide file tree
Showing 39 changed files with 67 additions and 473 deletions.
31 changes: 0 additions & 31 deletions tests/Issues/AnnotationImport/AnnotationImportTest.php

This file was deleted.

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

declare(strict_types=1);

namespace Rector\Core\Tests\Issues\AutoImportInAlias;
namespace Rector\Core\Tests\Issues\AutoImport;

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

final class AutoImportInAliasTest extends AbstractRectorTestCase
final class AutoImportTest extends AbstractRectorTestCase
{
#[DataProvider('provideData')]
public function test(string $filePath): void
Expand Down
23 changes: 23 additions & 0 deletions tests/Issues/AutoImport/Fixture/auto_import_in_alias.php.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

use stdClass as SomeObject;

final class AutoImport extends \stdClass
{
}

?>
-----
<?php

namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

use stdClass as SomeObject;

final class AutoImport extends SomeObject
{
}

?>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture;
namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

use PhpParser\Node\Expr\BinaryOp\Plus;
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus;

final class AutoImportInAliasSameLastName
final class AutoImportSameLastName
{
public function run(\PhpParser\Node\Expr\BinaryOp\Plus $plus)
{
Expand All @@ -20,12 +20,12 @@ final class AutoImportInAliasSameLastName
-----
<?php

namespace Rector\Core\Tests\Issues\AutoImportInAlias\Fixture;
namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

use PhpParser\Node\Expr\BinaryOp\Plus;
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus;

final class AutoImportInAliasSameLastName
final class AutoImportSameLastName
{
public function run(Plus $plus)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rector\Core\Tests\Issues\AutoImportBeforeDocblock\Fixture;
namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

/**
* License
Expand All @@ -24,7 +24,7 @@ final class DemoFile
-----
<?php

namespace Rector\Core\Tests\Issues\AutoImportBeforeDocblock\Fixture;
namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

/**
* License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Rector\Core\Tests\Issues\AutoImportDocInUse\Fixture;
namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Rector\Core\Tests\Issues\AutoImportDocInUse\Source\Annotation;
use Rector\Core\Tests\Issues\AutoImport\Source\Annotation;

final class SkipAutoImportDocInUseNamespace extends AbstractController
final class SkipAutoImportNamespace extends AbstractController
{
/**
* @Annotation\SomeEnum()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Rector\Core\Tests\Issues\AutoImport\Fixture;

use PhpParser\Node\Expr\BinaryOp\Plus;
use PhpParser\Node\Expr\AssignOp\Plus as AssignPlus;

final class SkipAutoImportSameLastNameDifferentFqcn
{
public function run(\Rector\Core\Tests\Issues\AutoImport\Source\Plus $plus)
{
}

public function run2(AssignPlus $plus)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Rector\Core\Tests\Issues\AutoImportDocInUse\Source\Annotation;
namespace Rector\Core\Tests\Issues\AutoImport\Source\Annotation;

use Doctrine\Common\Annotations\Annotation\Target;

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

declare(strict_types=1);

namespace Rector\Core\Tests\Issues\AutoImportDocInUse\Source\Annotation;
namespace Rector\Core\Tests\Issues\AutoImport\Source\Annotation;

use Doctrine\Common\Annotations\Annotation\Target;

Expand Down
9 changes: 9 additions & 0 deletions tests/Issues/AutoImport/Source/SomeClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Rector\Core\Tests\Issues\AutoImport\Source;

class SomeClass
{
}

This file was deleted.

43 changes: 0 additions & 43 deletions tests/Issues/AutoImportBeforeDocblock/Fixture/no_namespace.php.inc

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions tests/Issues/AutoImportDocInUse/AutoImportDocInUseTest.php

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions tests/Issues/AutoImportDocInUse/config/configured_rule.php

This file was deleted.

28 changes: 0 additions & 28 deletions tests/Issues/AutoImportGroupUse/AutoImportGroupUseTest.php

This file was deleted.

Loading

0 comments on commit 6dd57a9

Please sign in to comment.