Welcome Guest, Not a member yet? Register   Sign In
How to run a single seeder during unit test?
#4

(This post was last modified: 02-25-2023, 08:56 AM by grimpirate.)

If you're placing your file into app/Database/Seeds then your namespace is incorrect when you attempt to run it.

Code:
Currently: namespace Tests\Support\Database\Seeds;
Should be: namespace App\Database\Seeds;

If you're trying to see if your Seeder works try using the spark CLI and do the following:
Code:
php spark make:seeder Test --suffix
php spark db:seed TestSeeder

The seeder will do nothing, but it will create the appropriate namespaces and methods for you to modify according to your needs. Once you have it functioning as intended, then you can worry about its physical location in your system and modify the namespace accordingly.
Reply


Messages In This Thread
RE: How to run a single seeder during unit test? - by grimpirate - 02-25-2023, 08:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB