提交
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
$routes = file_get_contents(__DIR__ . '/../route/app.php');
|
||||
$routes = file_get_contents(__DIR__ . '/../app/miniapi/route/app.php');
|
||||
if (!is_string($routes)) {
|
||||
throw new RuntimeException('Unable to read route configuration');
|
||||
}
|
||||
|
||||
@@ -32,12 +32,26 @@ miniCorrectionAssertSame(
|
||||
'Authenticated user ID must override an untrusted client value'
|
||||
);
|
||||
|
||||
$routes = file_get_contents(__DIR__ . '/../route/app.php');
|
||||
$routeFile = __DIR__ . '/../app/miniapi/route/app.php';
|
||||
$routes = is_file($routeFile) ? file_get_contents($routeFile) : false;
|
||||
if (!is_string($routes)
|
||||
|| !str_contains($routes, "Route::get('evus/correction', 'EvusCorrection/detail');")
|
||||
|| !str_contains($routes, "Route::post('evus/correction/submit', 'EvusCorrection/submit');")
|
||||
) {
|
||||
throw new RuntimeException('The miniapi must register explicit correction detail and submit routes');
|
||||
throw new RuntimeException('The miniapi app must register explicit correction detail and submit routes in its multi-app route directory');
|
||||
}
|
||||
if (str_contains($routes, "Route::group('miniapi'")) {
|
||||
throw new RuntimeException('App-specific routes must not repeat the miniapi application prefix');
|
||||
}
|
||||
if (!str_contains($routes, "Route::pattern(['product_id' => '[A-Za-z0-9_-]+']);")
|
||||
|| !str_contains($routes, "Route::group('app', function () {")
|
||||
|| !str_contains($routes, "Route::get('bootstrap', 'AppCatalog/bootstrap');")
|
||||
|| !str_contains($routes, "Route::get('visas/:product_id', 'AppCatalog/detail');")
|
||||
) {
|
||||
throw new RuntimeException('The existing app catalog routes must remain available');
|
||||
}
|
||||
if (is_file(__DIR__ . '/../route/app.php')) {
|
||||
throw new RuntimeException('Multi-app routes must not remain in the ignored project-level route directory');
|
||||
}
|
||||
|
||||
$upload = file_get_contents(__DIR__ . '/../app/miniapi/controller/Upload.php');
|
||||
|
||||
Reference in New Issue
Block a user