This extension provides keyboard shortcuts to run Artisan Test commands in Visual Studio Code. It is especially useful for developers working with Laravel who want to run tests quickly.
Screenshots
Keyboard Shortcuts
Here are the available keyboard shortcuts and what each of them does:
Ctrl+Shift+F8: Runs the artisan test create command to create a new test file.
Ctrl+Shift+F9: Runs the artisan test command on the current file if the file ends with Test.php. Otherwise, it runs the artisan test --dirty command.
Ctrl+Shift+F11: Runs the artisan test command to run all tests.
Ctrl+Shift+F10: Runs the artisan test --filter command and prompts the user to enter the filter tag for the test.
Commands
Run Artisan Test
Command:artisanTest.runTest
Description: Runs the artisan test command and allows the user to choose between the options:
All Files
All Files With Parallel (--parallel)
Files Dirty (--dirty)
Run Artisan Test File
Command:artisanTest.runTestFile
Description: Runs the artisan test command on the current file if the file ends with Test.php.
Run Artisan Test Filter
Command:artisanTest.runTestFilter
Description: Runs the artisan test --filter command and prompts the user to enter the filter tag for the test.
Run Artisan Test Dirty
Command:artisanTest.runTestDirty
Description: Runs the artisan test --dirty command.
Create Test File
Command:artisanTest.runTestCreate
Description: Prompts the user to enter the test file name, select the test framework (Pest or PHPUnit), and select the test type (Feature or Unit). Creates a new test file using the selected options.
Installation
Install the extension from the Visual Studio Code Marketplace.
Open Visual Studio Code.
Go to the Extensions view (Ctrl+Shift+X).
Search for "Artisan Test Shortcut" and install the extension.
Usage
Open a Laravel project with PHP files in Visual Studio Code.
Use the keyboard shortcuts mentioned above to run the Artisan Test commands.
Contribution
Feel free to contribute with improvements or fixes. Fork the repository, create a branch for your changes, and submit a pull request.
Development
For instructions on how to develop and test this extension, see DEVELOPMENT.md.
License
This extension is licensed under the MIT license. See the LICENSE file for more information.