-
-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DX] Use own path normalizer (#2881)
- Loading branch information
1 parent
a80c361
commit 36ac530
Showing
10 changed files
with
142 additions
and
28 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Core\Tests\FileSystem; | ||
|
||
use Iterator; | ||
use PHPUnit\Framework\TestCase; | ||
use Rector\Core\FileSystem\FilePathHelper; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
|
||
final class FilePathHelperTest extends TestCase | ||
{ | ||
private FilePathHelper $filePathHelper; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->filePathHelper = new FilePathHelper(new Filesystem()); | ||
} | ||
|
||
/** | ||
* @dataProvider provideData() | ||
*/ | ||
public function test(string $inputPath, string $expectedNormalizedPath): void | ||
{ | ||
$normalizedPath = $this->filePathHelper->normalizePathAndSchema($inputPath); | ||
$this->assertSame($expectedNormalizedPath, $normalizedPath); | ||
} | ||
|
||
public function provideData(): Iterator | ||
{ | ||
// based on Linux | ||
yield ['/any/path', '/any/path']; | ||
yield ['\any\path', '/any/path']; | ||
} | ||
} |