Laravel 5.2: Unable to locate factory with name [default] April 17, 2023 by Tarik Some times it could be due to importing the wrong TestCase use PHPUnit\Framework\TestCase; [WRONG: and throws this error] use Tests\TestCase; [CORRECT]