I am trying to write some tests for my my Laravel 7 app.
But i keep facing A facade root has not been set.
error.
<?php
namespace Tests\Feature;
use Illuminate\Support\Facades\Config;
use PHPUnit\Framework\TestCase;
class AddressListenerRepositoryTest extends TestCase
{
public function testCreate()
{
Config::set('x', 'address_listeners'); // Cause of "A facade root has not been set" error
}
}
Can anybody explain the reason of this error?