diff --git a/tests/Feature/InertiaDevtoolsClosedTest.php b/tests/Feature/InertiaDevtoolsClosedTest.php new file mode 100644 index 00000000..2c12418d --- /dev/null +++ b/tests/Feature/InertiaDevtoolsClosedTest.php @@ -0,0 +1,38 @@ +assertFalse(config('inertia.devtools.enabled')); + $this->assertFalse(DevTools::enabled()); + $registered = collect(Route::getRoutes())->contains(fn ($route) => str_starts_with($route->uri(), '_inertia/devtools')); + $this->assertFalse($registered, 'As rotas de diagnóstico do Inertia não podem estar registadas.'); + } + + public function test_anonymous_requests_to_devtools_entries_are_not_found(): void + { + $this->getJson('/_inertia/devtools/entries')->assertNotFound(); + $this->getJson('/_inertia/devtools/entries/qualquer-id')->assertNotFound(); + } + + public function test_the_explicit_setting_still_wins_in_a_local_environment(): void + { + $this->app['env'] = 'local'; + $this->assertFalse(DevTools::enabled()); + } +}