Run your PHPUnit OR Pest tests in Node using the Test Explorer UI.
Include if your extension adds any VS Code settings through the contributes.configuration
extension point.
This extension contributes the following settings:
phpunit.php
: Absolute path to php. Fallback to global php if it exists on the command line.phpunit.phpunit
: Path to phpunit. Can be the phpunit file or phpunit.phar.\n\nAutomatically finds it in common places:\n - Composer vendor directory\n - phpunit.phar in your project\n - phpunit (or phpunit.bat for windows) globally on the command linephpunit.command
: Custom command to run. Ex: docker exec -t container_name
.phpunit.args
: Any phpunit args (phpunit --help) E.g. --configuration ./phpunit.xml.distphpunit.environment
: Set environment variables before running the phpunit command, Ex: { "XDEBUG_MODE": "coverage" } or "XDEBUG_MODE=coverage"phpunit.clearOutputOnRun
: True will clear the output when we run a new test. False will leave the output after every test.phpunit.showAfterExecution
: Specify if the test report will automatically be shown after executionphpunit.debuggerConfig
: Specify the debugger launch configurationThe following commands are available in VS Code's command palette, use the ID to add them to your keyboard shortcuts:
phpunit.reload
: PHPUnit: Reload testsphpunit.run-all
: PHPUnit: Run all testsphpunit.run-file
: PHPUnit: Run tests in current filephpunit.run-test-at-cursor
: PHPUnit: Run the test at the current cursor positionphpunit.rerun
: PHPUnit: Repeat the last test runProblem:
Path mapping with ${workspaceFolder}
does not work as expected.
Example:
{ "phpunit.paths": { "${workspaceFolder}": "/app" } }
Solution: Replace ${workspaceFolder} with the actual project path. For example:
{ "phpunit.paths": { "/myproject": "/app" } }Running test with XDEBUG_TRIGGER env
When you have a PHP Xdebug launch configuration like this below:
and you are using docker compose, setup the extension with the configuration below to enable debug if your xdebug.ini
configuration has xdebug.start_with_request=trigger
:
Then you can run the test with the "Debug Test" icon button. You can also run the test using the "Run Test" icon but you should have already started the Xdebug session from VSCode Debugger before running the test.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4