not->toBeFalse(); foreach ($forbiddenPatterns as $pattern) { if (preg_match($pattern, (string) $contents) === 1) { $violations[] = $relativePath; break; } } } expect($violations) ->toBeEmpty('Canonical admin surfaces must delegate tenant resolution to OperateHubShell. Offenders: '.implode(', ', $violations)); }); it('documents the approved panel-native exception inventory', function (): void { $notes = file_get_contents(base_path('docs/research/admin-canonical-tenant-rollout.md')); expect($notes)->not->toBeFalse(); foreach (adminTenantResolverExceptionFiles() as $relativePath) { expect($notes)->toContain($relativePath); } }); it('keeps the shared panel resolver explicit about admin and tenant-panel resolution', function (): void { $resolverContents = file_get_contents(base_path('app/Filament/Concerns/ResolvesPanelTenantContext.php')); $contents = file_get_contents(base_path('app/Filament/Resources/EntraGroupResource.php')); expect($resolverContents)->not->toBeFalse() ->and($resolverContents)->toContain('tenantOwnedPanelContext(request())') ->and($resolverContents)->toContain('Tenant::current()'); expect($contents)->not->toBeFalse() ->and($contents)->toContain('use ResolvesPanelTenantContext;') ->and($contents)->not->toContain('activeEntitledTenant(request())') ->and($contents)->not->toContain('Tenant::current()'); });