-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.x] Add
Orchestra\Testbench\transform_realpath_to_relative
functi…
…on (#276) * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
- Loading branch information
Showing
11 changed files
with
113 additions
and
83 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,43 @@ | ||
<?php | ||
|
||
namespace Orchestra\Testbench\Tests\Helpers; | ||
|
||
use Orchestra\Testbench\TestCase; | ||
|
||
use function Orchestra\Testbench\default_skeleton_path; | ||
use function Orchestra\Testbench\join_paths; | ||
use function Orchestra\Testbench\package_path; | ||
use function Orchestra\Testbench\transform_realpath_to_relative; | ||
|
||
class TransformRealpathToRelativeTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_use_transform_realpath_to_relative() | ||
{ | ||
$this->assertSame('Testbench.php', transform_realpath_to_relative('Testbench.php')); | ||
|
||
$this->assertSame( | ||
join_paths('.', 'src', 'TestCase.php'), | ||
transform_realpath_to_relative(package_path('src', 'TestCase.php')) | ||
); | ||
|
||
$this->assertSame( | ||
join_paths('@laravel', 'composer.json'), | ||
transform_realpath_to_relative(default_skeleton_path('composer.json')) | ||
); | ||
|
||
$this->assertSame( | ||
join_paths('@workbench', 'app', 'Providers', 'WorkbenchServiceProvider.php'), | ||
transform_realpath_to_relative(package_path('workbench', 'app', 'Providers', 'WorkbenchServiceProvider.php')) | ||
); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_use_transform_realpath_to_relative_using_custom_working_path() | ||
{ | ||
$this->assertSame( | ||
join_paths('@tests', 'Helpers', 'TransformRealpathToRelativeTest.php'), | ||
transform_realpath_to_relative(__FILE__, package_path('tests'), '@tests') | ||
); | ||
} | ||
} |
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