@alexgodbehere You might want to consider using the DatabaseTransactions trait. You can seed your database once, and DatabaseTransactions will still roll back the test transactions at the end of the tests, but won't run the migrations; meaning your seeded data will persist thru the tests. The only thing you need to be mindful of, is you will need to manually run the migrations on your test database to bring them up-to-date when you make changes to your database structure.
If you don't want to use DatabaseTransactions, another option you can try is an in-memory sqlite database. It's very easy to set up, and is exponentially faster than using a mysql database for testing.
Just install sqlite, set up a connection in your config/database.php file, and alter your phpunit.xml file with these values:
config/database.php:
'sqlite_testing' => [
'driver' => 'sqlite',
'database' => database_path('testing.sqlite'),
'prefix' => '',
],
<env name="DB_CONNECTION" value="sqlite_testing"/>
<env name="DB_DATABASE" value=":memory:"/>
sqlite_testing = whatever you called it in your config/database.php
Also, make sure you create the sqlite database file within database/testing.sqlite. It just needs to be an empty file. If using mac/linux, you can just run touch database/testing.sqlite