Skip to content

Commit 1c4ffcb

Browse files
committed
test for layouts in a layouts subdirectory
1 parent ea501f5 commit 1c4ffcb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/View/Antlers/ViewTest.php

+14
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ function combines_two_views()
4040
});
4141
}
4242

43+
/** @test */
44+
function a_layout_can_be_in_the_layouts_directory()
45+
{
46+
$this->viewShouldReturnRaw('template', file_get_contents(__DIR__.'/fixtures/template.antlers.html'));
47+
$this->viewShouldReturnRaw('layouts.test', file_get_contents(__DIR__.'/fixtures/layout.antlers.html'));
48+
49+
$view = (new View)
50+
->template('template')
51+
->layout('test')
52+
->with(['foo' => 'bar']);
53+
54+
$this->assertEquals('Layout: bar | Template: bar', $view->render());
55+
}
56+
4357
/** @test */
4458
function template_is_rendered_alone_if_no_layout_is_provided()
4559
{

0 commit comments

Comments
 (0)