From ed13f7a8d48db200b0331aed1910f4a8431a17ba Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Fri, 24 Apr 2026 15:51:09 +0200 Subject: [PATCH] Add guarded legacy route shims for Edge Gateway with corresponding unit tests --- .../app/routes/edgeGatewayConfigRoute.php | 11 +++++++++++ .../nginx/app/routes/edgeGatewaysRoute.php | 11 +++++++++++ .../app/routes/moduleEdgeGatewayRoute.php | 11 +++++++++++ .../EdgeGatewayLegacyRouteShimTest.php | 19 +++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 services/nginx/app/routes/edgeGatewayConfigRoute.php create mode 100644 services/nginx/app/routes/edgeGatewaysRoute.php create mode 100644 services/nginx/app/routes/moduleEdgeGatewayRoute.php create mode 100644 services/nginx/app/tests/Unit/Selfserve/EdgeGatewayLegacyRouteShimTest.php diff --git a/services/nginx/app/routes/edgeGatewayConfigRoute.php b/services/nginx/app/routes/edgeGatewayConfigRoute.php new file mode 100644 index 00000000..96758795 --- /dev/null +++ b/services/nginx/app/routes/edgeGatewayConfigRoute.php @@ -0,0 +1,11 @@ +isEnabled()) { + return; + } +} catch (\Throwable $exception) { + return; +} + +require_once __DIR__ . '/../modules/edgegateway/routes/edgeGatewayConfigRoute.php'; diff --git a/services/nginx/app/routes/edgeGatewaysRoute.php b/services/nginx/app/routes/edgeGatewaysRoute.php new file mode 100644 index 00000000..be5b84c3 --- /dev/null +++ b/services/nginx/app/routes/edgeGatewaysRoute.php @@ -0,0 +1,11 @@ +isEnabled()) { + return; + } +} catch (\Throwable $exception) { + return; +} + +require_once __DIR__ . '/../modules/edgegateway/routes/edgeGatewaysRoute.php'; diff --git a/services/nginx/app/routes/moduleEdgeGatewayRoute.php b/services/nginx/app/routes/moduleEdgeGatewayRoute.php new file mode 100644 index 00000000..e733b9de --- /dev/null +++ b/services/nginx/app/routes/moduleEdgeGatewayRoute.php @@ -0,0 +1,11 @@ +isEnabled()) { + return; + } +} catch (\Throwable $exception) { + return; +} + +require_once __DIR__ . '/../modules/edgegateway/routes/moduleEdgeGatewayRoute.php'; diff --git a/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayLegacyRouteShimTest.php b/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayLegacyRouteShimTest.php new file mode 100644 index 00000000..ea465a4b --- /dev/null +++ b/services/nginx/app/tests/Unit/Selfserve/EdgeGatewayLegacyRouteShimTest.php @@ -0,0 +1,19 @@ +not->toBeFalse(); + expect($shimSource)->toContain('new \\classes\\edgegateway()'); + expect($shimSource)->toContain('isEnabled()'); + expect($shimSource)->toContain("modules/edgegateway/routes/{$legacyShim}"); + } +});