Laravel facade class not found when mocked in a unit test
it's because laravel framework is not loaded before using facade OR it because you are not using laravel php unit(TestCase class)here is a sample code to test case that are in app///attention to extends from TestCase not ()
/** * TEST CASE the application. * */class TestCase extends Illuminate\Foundation\Testing\TestCase { /** * Creates the application. * * @return \Symfony\Component\HttpKernel\HttpKernelInterface */ public function createApplication() { $unitTesting = true; $testEnvironment = 'testing'; //this line boot the laravel framework so all facades are in your hand return require __DIR__.'/../../bootstrap/start.php'; }}