I need to use the DB facade within the tests, however I am getting the errorA facade root has not been set.
I have tried to load the facade in a TestCase extension as follows:
protected function getPackageAliases($app)
{
return [
'DB' => 'Illuminate\Support\Facades\DB'
];
}
protected function getEnvironmentSetUp($app)
{
$app->withFacades();
}
However, I still keep getting the same error. Given the structure of the application, I require a connection to the database, using mockery is not an option.