<?php

namespace MintyPHP\Tests\Architecture;

use PHPUnit\Framework\TestCase;

final class SecurityLoggingTelemetryContractTest extends TestCase
{
    use ProjectFileAssertionSupport;

    public function testFrontendTelemetrySanitizesSecretsAndPiiMarkers(): void
    {
        $content = $this->readProjectFile('modules/audit/lib/Module/Audit/Service/FrontendTelemetryIngestService.php');

        self::assertStringContainsString('[REDACTED]', $content);
        self::assertStringContainsString('[REDACTED_EMAIL]', $content);
        self::assertStringContainsString('[UUID]', $content);
        self::assertStringContainsString('[TOKEN]', $content);
        self::assertStringContainsString('(token|access_token|refresh_token|id_token|authorization|api_key|secret)', $content);
    }
}
