create(); Setting::set('active_theme', 'bloody'); $page = Page::create([ 'user_id' => $user->id, 'title' => 'Home', 'slug' => 'home', 'content' => [], 'is_published' => true, ]); $layoutPath = base_path('themes/bloody/layout.blade.php'); $originalContent = file_get_contents($layoutPath); try { // Revert it to the broken state (no namespace) file_put_contents($layoutPath, str_replace("themes::navigation", "navigation", $originalContent)); $this->get('/') ->assertStatus(500); } finally { file_put_contents($layoutPath, $originalContent); } } public function test_it_succeeds_to_include_navigation_with_shortened_namespace() { $user = User::factory()->create(); Setting::set('active_theme', 'bloody'); $page = Page::create([ 'user_id' => $user->id, 'title' => 'Home', 'slug' => 'home', 'content' => [], 'is_published' => true, ]); $this->get('/') ->assertStatus(200) ->assertSee('Home'); } }