I’ve always used the phpunit to execute my tests, and just recently stumbled upon the php artisan test command, and it looks like it has some benefits to it. However, when I try to run it, I get the response
Command "test" is not defined.
It might be worth adding that I'm on version 7.14.1, and my other projects on the same version doesn't have this issue.
Thanks for your reply. I already tried composer dump-autoload, with no luck.
In fact, the test command doesn't show up in the list. It had me thinking, a while ago I had a command called test:run (before I was aware of this artisan command), but it has been removed now. Could this be causing my current issue?
I don't think so. Just make sure that you are really running the 7.14 version as you say by running php artisan --version because on my project I have 7.7.1 and the command is there.
Make sure you update all the dependencies as well.
Alright, so I pulled up the composer.json file from my other project, and compared my dependencies. For some reason, I was missing nunomaduro/collision.
Thanks both for your replies, they got me in the right direction.
Just to confirm that composer install ... --no-dev removes the test command (in my case it was composer install --optimize-autoloader --no-dev). This is fixed with composer install
In case it can help someone in the future: I solved this by deleting the bootstrap/cache/packages.php file (there's probably an artisan command that clears it as well, but I did it manually in my case).