-
Notifications
You must be signed in to change notification settings - Fork 142
Fix PHPStorm using absolute paths #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5f0a446
Fix PHPStorm on Windows v1
ashleyhindle aaf038d
feat: use absolute path for phpstorm with test
ashleyhindle e172266
refactor: streamline path resolution and simplify the MCP client inte...
pushpak1300 2bc02f8
Fix code styling
pushpak1300 6e29dbf
refactor: simplify artisan path resolution by removing fallback
pushpak1300 a517e34
Fix code styling
pushpak1300 01204b8
refactor: simplify artisan path resolution logic
pushpak1300 cbba494
refactor: update artisan path resolution to use current working direc...
pushpak1300 44b2001
Merge pull request #111 from laravel/refactor/#109
ashleyhindle e0a03cc
reuse $php for herd install
ashleyhindle 605e2af
Merge branch 'main' into fix-phpstorm-on-windows-v1
pushpak1300 51ce47b
refactor: use `base_path` for artisan path resolution
pushpak1300 e9c56dc
Merge branch 'main' into fix-phpstorm-on-windows-v1
ashleyhindle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
39 changes: 39 additions & 0 deletions
tests/Feature/Install/CodeEnvironment/CodeEnvironmentPathResolutionTest.php
This file contains hidden or 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,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Laravel\Boost\Install\CodeEnvironment\Cursor; | ||
use Laravel\Boost\Install\CodeEnvironment\PhpStorm; | ||
use Laravel\Boost\Install\Detection\DetectionStrategyFactory; | ||
|
||
test('PhpStorm returns absolute PHP_BINARY path', function () { | ||
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class); | ||
$phpStorm = new PhpStorm($strategyFactory); | ||
|
||
expect($phpStorm->getPhpPath())->toBe(PHP_BINARY); | ||
}); | ||
|
||
test('PhpStorm returns absolute artisan path', function () { | ||
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class); | ||
$phpStorm = new PhpStorm($strategyFactory); | ||
|
||
$artisanPath = $phpStorm->getArtisanPath(); | ||
|
||
// Should be an absolute path ending with 'artisan' | ||
expect($artisanPath)->toEndWith('artisan') | ||
->and($artisanPath)->not()->toBe('./artisan'); | ||
}); | ||
|
||
test('Cursor returns relative php string', function () { | ||
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class); | ||
$cursor = new Cursor($strategyFactory); | ||
|
||
expect($cursor->getPhpPath())->toBe('php'); | ||
}); | ||
|
||
test('Cursor returns relative artisan path', function () { | ||
$strategyFactory = Mockery::mock(DetectionStrategyFactory::class); | ||
$cursor = new Cursor($strategyFactory); | ||
|
||
expect($cursor->getArtisanPath())->toBe('./artisan'); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.