create(['status' => 'active']); [$user] = createUserWithTenant($tenant, role: 'readonly'); $this->actingAs($user) ->get("/admin/managed-tenants/{$tenant->id}/open") ->assertRedirect('/admin/managed-tenants/current') ->assertSessionHas(ManagedTenantContext::CURRENT_TENANT_ID_SESSION_KEY, $tenant->id); $this->withSession([ ManagedTenantContext::CURRENT_TENANT_ID_SESSION_KEY => $tenant->id, ])->actingAs($user) ->get('/admin/managed-tenants/current') ->assertOk() ->assertSee($tenant->name); });