nunomaduro / collision

💥 Collision is a beautiful error reporting tool for command-line applications
https://nunomaduro.com
MIT License
4.49k stars 156 forks source link

Catch PHPUnit Errors and Deprecations #280

Closed Jubeki closed 1 year ago

Jubeki commented 1 year ago

Fixes #271

Currently php artisan test doesn't display PHPUnit Errors or Deprecations, which can be quite important for seeing tests which are not running or failing due to an Error in a Data Provider for example.

This PR registeres the two additional Subscriber to listen for this events and display them in the console.

I created an example repository to show the issue:

Setting up the repository

git clone git@github.com:Jubeki/nunomaduro-collission-example.git
composer update
cp .env.example .env
php artisan key:generate

Output of php artisan test without this PR:

Screenshot 2023-08-03 at 10 56 59

Output of vendor/bin/phpunit:

Screenshot 2023-08-03 at 10 57 25

You can see that the test y is not running in php artisan test but you would'nt know that. You can also not see the deprecation like with vendor/bin/phpunit

To see the results of this PR you can do the following:

cp composer-remote.json composer.json
composer update

Output of php artisan test with this PR:

Screenshot 2023-08-03 at 10 57 57
Jubeki commented 1 year ago

Errors seem unrelated to my PR changes. Tests are failing because of composer conflicts.