-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Replace wildcard e2e test with unit one (#5000)
- Loading branch information
1 parent
9e7367c
commit 596bbc9
Showing
17 changed files
with
86 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
e2e/wildcards-path-config/packages/target/src/AlreadyChangedDocblock.php
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
e2e/wildcards-path-config/packages/target/src/RenameDocblock.php
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
e2e/wildcards-path-config/packages/target/src/UselessVarTag.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests-paths/path/wildcard-nested/some_directory/AnotherFile.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Utils\Path\WhildcardNested; | ||
|
||
final class AnotherFile | ||
{ | ||
public function run() | ||
{ | ||
return 123; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
tests-paths/path/wildcard-next/some_directory/YetAnotherFile.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Utils\Path\WhildcardNested; | ||
|
||
final class YetAnotherFile | ||
{ | ||
public function run() | ||
{ | ||
return 123; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\Tests\Configuration; | ||
|
||
use Rector\Core\Configuration\ConfigurationFactory; | ||
use Rector\Core\FileSystem\FilesFinder; | ||
use Rector\Testing\PHPUnit\AbstractTestCase; | ||
|
||
final class ConfigurationFactoryTest extends AbstractTestCase | ||
{ | ||
public function test(): void | ||
{ | ||
$configurationFactory = $this->make(ConfigurationFactory::class); | ||
$configuration = $configurationFactory->createForTests([ | ||
__DIR__ . '/../../tests-paths/path/*/some_directory/*', | ||
]); | ||
|
||
$filesFinder = $this->make(FilesFinder::class); | ||
|
||
$filePaths = $filesFinder->findInDirectoriesAndFiles($configuration->getPaths()); | ||
$this->assertCount(2, $filePaths); | ||
|
||
$firstFilePath = $filePaths[0]; | ||
$secondFilePath = $filePaths[1]; | ||
|
||
$this->assertSame( | ||
realpath(__DIR__ . '/../../tests-paths/path/wildcard-nested/some_directory/AnotherFile.php'), | ||
realpath($firstFilePath) | ||
); | ||
|
||
$this->assertSame( | ||
realpath(__DIR__ . '/../../tests-paths/path/wildcard-next/some_directory/YetAnotherFile.php'), | ||
realpath($secondFilePath), | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.