I'm trying to add a Factory to help increment my test coverage on some controllers. I've been using Factories with no issues till now, where I find no reason for this message and I can't figure out what is different from the rest of the factories, which are working perfectly.
The error is:
1) GuestBusinessControllerTest::it_presents_a_domain_home
InvalidArgumentException: Unable to locate factory with name [default] [App\Models\Domain].
In order not to make a never-ending post of code crap, I reference the useful files as follows:
- My Controller Test trying to use the Factory (Through a trait): GuestBusinessControllerTest
- The trait using the factory
- The factory definition
- I'm using "laracasts/testdummy": "~2.0"
Sidenotes:
Yes, I did
composer dump-autoload
(Else, the error message would be different)I tried to define the factory in another helper file, and
dump-autoload
. (Just in case)I also tried renaming my model, thinking that
Domain
might be a conflicting keyword, but that seems not to be the issue.
How may I solve this error?
via Chebli Mohamed
1 commentaire:
you need to call parent::setUp() in your setUp;
Enregistrer un commentaire