create(); $otherTenant = Tenant::factory()->create(); [$user] = createUserWithTenant($tenant); $user->tenants()->syncWithoutDetaching([ $otherTenant->getKey() => ['role' => 'owner'], ]); $visibleSet = BackupSet::factory()->create([ 'tenant_id' => $tenant->getKey(), 'name' => 'visible-backup-set', ]); $hiddenSet = BackupSet::factory()->create([ 'tenant_id' => $otherTenant->getKey(), 'name' => 'hidden-backup-set', ]); bindFailHardGraphClient(); $response = $this->actingAs($user) ->get(BackupSetResource::getUrl('index', tenant: $tenant)) ->assertOk() ->assertSee('Created by'); $content = (string) $response->getContent(); preg_match('/
]*>(.*?)<\\/tbody>/is', $content, $tbodyMatch); $tableCellText = html_entity_decode(strip_tags((string) ($tbodyMatch[1] ?? ''))); expect($tableCellText) ->toContain($visibleSet->name) ->not->toContain($hiddenSet->name); });