Image: Pixabay If integration tests take too long to run then we stop running them because they're just an annoyance. This is obviously not ideal and so getting my tests to run quickly is important. I'm busy writing a test suite for Laravel and wanted more flexibility than the built-in options that Laravel offers for working with databases between tests. Using the DataMigrations trait meant that my seed data would be lost after every test. Migrating and seeding my entire database for every test in my suite is very time consuming. Even when using an in-memory sqlite database doing a complete migration and seed was taking several seconds on my dev box. If I used the DataTransactions trait then my migrations and seeds would never run and so my tests would fail because the fixture data is missing. My solution was to use a static variable in the base TestCase class that Laravel supplies. It has to be static so that it retains its values between tests by the wa...