Skip to content

Commit

Permalink
test for layouts in a layouts subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Dec 17, 2019
1 parent ea501f5 commit 1c4ffcb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/View/Antlers/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 1c4ffcb

Please sign in to comment.