From 2b6c6347147720dea5c6d3397783ccb5c73fed79 Mon Sep 17 00:00:00 2001 From: nala Date: Wed, 2 Dec 2026 23:59:53 +0200 Subject: [PATCH] =?UTF-8?q?Teste=20de=20regress=C3=A3o:=20diagn=C3=B3stico?= =?UTF-8?q?=20do=20Inertia=20fechado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01MzJmxFj5qy3mpHxUj7Q4ap --- tests/Feature/InertiaDevtoolsClosedTest.php | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/Feature/InertiaDevtoolsClosedTest.php 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()); + } +}