Using factory in PHPUnit provider fails

Posted 2 years ago by webcodecs

Hey guys, i try to use a factory to makeusers in a provider. If i use the factory in the test directly, there was no problem. If i try to use it in a testing provider i get an error message:

The data provider specified for Tests\Unit\Model\UserTests::createAnUserInDBAsExpected is invalid.
Unable to locate factory with name [default] [App\Models\User].

This is my call to the factory:

factory(\App\Models\User::class)->make();

Does anyone has an idea?

Best regards

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

Reply to

Use Markdown with GitHub-flavored code blocks.