-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Description
- Laravel Version: 6.8.0
- PHP Version: 7.3.9
- PHPUnit Version: 8.5.0
- Database Driver & Version: MariaDb 10.4.6
Description:
Using factories in Unit-tests don't work in a new laravel project. Perhaps it is intended, but then it should be in the documentation. And I believe I have used factories in Unittests before...
Steps To Reproduce:
- Create a new laravel project
- Change the 'tests > Unit > ExampleTest > testExample' to
public function testBasicTest()
{
factory('App\User')->make();
$this->assertTrue(true);
}
- Run the Test
Now the tests throws an error, saying:
InvalidArgumentException: Unable to locate factory with name [default] [App\User].
As expected it does not make a difference if using the User::class Property as param
Using the same code in featuretests works as expected.
Metadata
Metadata
Assignees
Labels
No labels