From 1c4ffcb31eb6b8ce5aa6caee657d05c46b15f6f0 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Tue, 17 Dec 2019 16:32:12 -0500 Subject: [PATCH] test for layouts in a layouts subdirectory --- tests/View/Antlers/ViewTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/View/Antlers/ViewTest.php b/tests/View/Antlers/ViewTest.php index ef7769f42d..c054e69fab 100644 --- a/tests/View/Antlers/ViewTest.php +++ b/tests/View/Antlers/ViewTest.php @@ -40,6 +40,20 @@ function combines_two_views() }); } + /** @test */ + function a_layout_can_be_in_the_layouts_directory() + { + $this->viewShouldReturnRaw('template', file_get_contents(__DIR__.'/fixtures/template.antlers.html')); + $this->viewShouldReturnRaw('layouts.test', file_get_contents(__DIR__.'/fixtures/layout.antlers.html')); + + $view = (new View) + ->template('template') + ->layout('test') + ->with(['foo' => 'bar']); + + $this->assertEquals('Layout: bar | Template: bar', $view->render()); + } + /** @test */ function template_is_rendered_alone_if_no_layout_is_provided() {