sustained
10 months ago

Automatic DB seeding for tests.

Posted 10 months ago by sustained

On one of my projects I don't need to call $this->seed() or $this->artisan('db:seed') at all and seeding just works by default.

On another project I just started, I have to call those in setUp otherwise the DB is blank.

Both are using SQlite and :inmemory:, same version of PHP+Laravel+SQlite, same machine even.

Both are using the same base TestCase:

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;
    use RefreshDatabase;
    // use DatabaseMigrations;
}

I don't understand.

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