Add guarded legacy route shims for Edge Gateway with corresponding unit tests
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
if (!class_exists(\classes\edgegateway::class) || !(new \classes\edgegateway())->isEnabled()) {
|
||||
return;
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../modules/edgegateway/routes/edgeGatewayConfigRoute.php';
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
if (!class_exists(\classes\edgegateway::class) || !(new \classes\edgegateway())->isEnabled()) {
|
||||
return;
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../modules/edgegateway/routes/edgeGatewaysRoute.php';
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
try {
|
||||
if (!class_exists(\classes\edgegateway::class) || !(new \classes\edgegateway())->isEnabled()) {
|
||||
return;
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../modules/edgegateway/routes/moduleEdgeGatewayRoute.php';
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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}");
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user