. */ namespace Tests; use App\PhoneCountry; use App\Space; use App\Http\Middleware\SpaceCheck; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Illuminate\Foundation\Testing\RefreshDatabase; abstract class TestCase extends BaseTestCase { use CreatesApplication; use RefreshDatabase; use TestUtilsTrait; protected $route = '/api/accounts/me'; protected $method = 'GET'; public function setUp(): void { parent::setUp(); $this->withoutMiddleware([SpaceCheck::class]); config()->set('app.sip_domain', 'sip.example.com'); PhoneCountry::truncate(); PhoneCountry::factory()->france()->activated()->create(); PhoneCountry::factory()->netherlands()->create(); } protected function setSpaceOnRoute(Space $space, string $route) { return str_replace('localhost', $space->domain, $route); } }