Level 74
- Do you have a Role.php in your App directory?
- Does it have the correct namespace?
$roles = factory(App\Role::class, 5)->create();
$tags = factory(App\Tag::class, 20)->create();
when i run phpunit, i always got Error: Class 'Tests\Feature\App\Role' not found,
I've tried to add use App\Role too but it does not work either. what am i missing?
The error says it's looking for Tests\Feature\App\Role. If you want App\Role, try $roles = factory(\App\Role::class, 5)->create();
In use-statements, App\Role is sufficient since it starts at the root, however then you need to update your usage to
$roles = factory(Role::class, 5)->create();
Please or to participate in this conversation.