Check for names the site already uses, and bring the docs up to 0.5.0

This commit is contained in:
Matthijs Iriks committed 2026-12-04 05:42:12 +01:00
1 parent a921f14d85
commit 541d1ee690
8 files changed
+77 -8

No files matched your search

+21
View File
@@ -73,3 +73,24 @@ it('leaves the check to a new process after it changed the switches', function (
expect(Artisan::output())->toContain('manager:doctor')->not->toContain('[OK]');
});
it('finds no shared names in a clean setup', function () {
$check = collect(doctorReport()['checks'])->firstWhere('check', 'names');
expect($check['message'])->toBe('No route name or address is shared with the site.');
});
it('warns when the site uses a route name of the manager, and says what to set', function () {
Route::get('/home', fn () => 'x')->name('manager.dashboard');
$check = collect(doctorReport()['checks'])->firstWhere('check', 'names');
expect($check['status'])->toBe('warn')->and($check['message'])->toContain('manager.dashboard')->and($check['fix'])->toContain('route_name');
});
it('warns when the site has routes under the address of the manager', function () {
Route::get('/manager/reports', fn () => 'x');
$check = collect(doctorReport()['checks'])->firstWhere('check', 'names');
expect($check['status'])->toBe('warn')->and($check['message'])->toContain('manager/reports');
});