5 months ago

Phpunit crashes after I created a console command that reads from the database

Posted 5 months ago by arthurvillar

So I have an app working well, with many unit tests. All is good until I create some console commands that search the database for various reasons to send out emails, etc. At that moment all my tests crash with the no such table message.

After some moments of agony, I realized that the database call on the console command seems to be running before the test has a chance to migrate the tables and set up the application. Any ideas on how I can fix this?

Please sign in or create an account to participate in this conversation.