47 lines
1.7 KiB
PHP
47 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
it('Spec417 keeps canonical identity backend-only without legacy ownership or UI activation', function (): void {
|
|
expect(Schema::hasColumn('tenant_configuration_resources', 'tenant_id'))->toBeFalse()
|
|
->and(Schema::hasColumn('tenant_configuration_resources', 'canonical_key'))->toBeFalse();
|
|
|
|
$identityUiMentions = collect([
|
|
...glob(base_path('app/Filament/**/*'), GLOB_BRACE),
|
|
...glob(base_path('resources/views/**/*'), GLOB_BRACE),
|
|
...glob(base_path('routes/*.php'), GLOB_BRACE),
|
|
])
|
|
->filter(static fn (string $path): bool => is_file($path))
|
|
->filter(static fn (string $path): bool => str_contains(file_get_contents($path) ?: '', 'canonical-identity'))
|
|
->values();
|
|
|
|
expect($identityUiMentions->all())->toBe([]);
|
|
|
|
$activeTenantConfigurationFiles = collect([
|
|
...glob(base_path('app/Services/TenantConfiguration/*.php'), GLOB_BRACE),
|
|
...glob(base_path('app/Support/TenantConfiguration/*.php'), GLOB_BRACE),
|
|
])->filter(static fn (string $path): bool => is_file($path));
|
|
|
|
foreach ([
|
|
'ambiguous_match',
|
|
'policy_record_missing',
|
|
'foundation_not_policy_backed',
|
|
'meta_fallback',
|
|
'raw_gap_count',
|
|
'primary_gap_count',
|
|
'v1_to_v2',
|
|
'fallback_to_latest',
|
|
'dual_write',
|
|
] as $legacyTerm) {
|
|
$matches = $activeTenantConfigurationFiles
|
|
->filter(static fn (string $path): bool => str_contains(file_get_contents($path) ?: '', $legacyTerm))
|
|
->values()
|
|
->all();
|
|
|
|
expect($matches)->toBe([], "{$legacyTerm} must not be active Coverage v2 identity truth.");
|
|
}
|
|
});
|
|
|