create(); Setting::set('active_theme', 'bloody-child'); Page::create([ 'user_id' => $user->id, 'title' => 'Home', 'slug' => 'home', 'content' => [], 'is_published' => true, ]); // When we access the home page, it should use themes::layout. // themes::layout is NOT in bloody-child, but IS in bloody. // It should fallback correctly. $this->get('/') ->assertStatus(200) ->assertSee('Home'); } public function test_child_theme_can_override_parent_views() { $user = User::factory()->create(); Setting::set('active_theme', 'bloody-child'); // Create an overridden navigation in the child theme File::put(base_path('themes/bloody-child/navigation.blade.php'), ''); Page::create([ 'user_id' => $user->id, 'title' => 'Home', 'slug' => 'home', 'content' => [], 'is_published' => true, ]); // It should use the child navigation instead of the parent one $this->get('/') ->assertStatus(200) ->assertSee('CHILD NAVIGATION') ->assertDontSee('Blog') // Original navigation had Blog ->assertDontSee('Calendar'); } }