Closed RCady closed 1 year ago
Currently you can toggle the --testdox
option from the command palette which will give you a similar output.
One way to hack it is the following:
"phpunit.prepend_cmd": ["artisan"],
"phpunit.executable": "test",
"phpunit.options":
{
"colors=never": true,
},
This prepends artisan
and replaces the executable with test
which gets you artisan test
. A bit hacky but works.
The colors option is required because artisan prints colors codes. PHPUnit defaults to --colors=auto
which disables colors when run in Sublime Text.
The problem is that artisan still prints some color codes which is similar to the same issue Pest has (see https://github.com/gerardroche/sublime-phpunit/issues/103):
It also prints a TTY warning that I don't understand yet:
Warning: TTY mode requires /dev/tty to be read/writable.
In the next version you will be able to set the executable as a list:
"phpunit.executable": ["artisan", "test"],
"phpunit.options":
{
"colors=never": true,
},
I added the boolean setting phpunit.artisan
. Just set it to true to enable the Artisan test runner.
I opened an issue in the Laravel tracker for the color output issues: https://github.com/laravel/framework/issues/46759.
Please open issues about missing syntax highlighting of the output.
Laravel's
artisan test
command offers some styling upgrades on top of PHPUnit's.artisan test
passes all arguments directly to PHPUnit.It would be nice to add Laravel/Artisan detection and adjust the command to utilize this.
I plan to create a Pull Request with the changes in the near future.