-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
php artisan test
returns exit code 1 if phpunit has warnings, doesn't display them
#51272
Comments
Hi @imaginedbyme, |
Ah I didn't see this was from a different package, my apologies I'll close this, thanks for the feedback @staudenmeir ! |
I managed to fix this.. there was a class that doesn't have any test case.. i deleted it and it worked so double check your test files |
Thank you @khalidmaquilang I also had a class without a test inside; I removed it, and everything worked! Thanks! |
Laravel Version
10.31.0
PHP Version
8.2
Database Driver & Version
No response
Description
If you use phpunit tests with Laravel, and run them using
php artisan test
, the tests can all pass and still return an exit code of 1 if phpunit has warnings artisan doesn't display. This makes GitHub actions testing Laravel projects fail with no warnings/errors if the run command isphp artisan test
and the current documentation doesn't say anything about it suppressing phpunit warnings.Steps To Reproduce
If you create a test file but comment any tests out, phpunit returns it as a warning but artisan doesn't, leading to an exit code of 1 with no visible reason why, only by running
./vendor/bin/phpunit
can you see the warnings.The text was updated successfully, but these errors were encountered: