<?php

it('keeps guarded legacy root shims for moved edge gateway routes', function (): void {
    $routesDirectory = app_path() . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR;
    $legacyShims = [
        'edgeGatewaysRoute.php',
        'edgeGatewayConfigRoute.php',
        'moduleEdgeGatewayRoute.php',
    ];

    foreach ($legacyShims as $legacyShim) {
        $shimSource = file_get_contents($routesDirectory . $legacyShim);

        expect($shimSource)->not->toBeFalse();
        expect($shimSource)->toContain('new \\classes\\edgegateway()');
        expect($shimSource)->toContain('isEnabled()');
        expect($shimSource)->toContain("modules/edgegateway/routes/{$legacyShim}");
    }
});
