set('app.maintenance.store', 'array'); InstanceSettings::forceCreate(['id' => 0]); $team = Team::factory()->create(); $user = User::factory()->create(); $team->members()->attach($user, ['role' => 'owner']); $this->actingAs($user); session(['currentTeam' => $team]); $this->get('/security/private-key/some-key-uuid')->assertRedirect(route('security.private-key.index')); });