Laravel 5.7 Unable to locate factory with name [default] [App\User]
The error is also thrown due to importing the wrong TestCase and not just parent::setUp();
only
-
use PHPUnit\Framework\TestCase;
[WRONG: and throws this error]
use Tests\TestCase;
[CORRECT]
Ohh shoot! parent::setUp()
fixed this issue.
public function setUp()
{
parent::setUp();
// more codes here
}