I'm trying to test my app using phpunit with laravel but each time I run
unit test
vendor\bin\phpunit
All tables in my database drop so I have to migrate each time I run a test
Have you encountered with similar issue & how can I fix it ?
Use a separate connection for tests. Add this connection to config/database.php config file:
'connections' => [
'testing' => [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
],