Skip to content

Commit

Permalink
Cleanup formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 26, 2024
1 parent 4868497 commit 990a561
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/framework/src/Support/Includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* Both Markdown and Blade includes will be rendered to HTML.
*/
class Includes
class Include
{
/**
* @var string The directory where includes are stored.
Expand Down
8 changes: 6 additions & 2 deletions packages/framework/tests/Unit/IncludesFacadeUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ public function testHtmlReturnsDefaultValueWhenNotFound()

public function testHtmlWithAndWithoutExtension()
{

$this->mockFilesystem(function ($filesystem) {
$filename = 'foo.html';
$content = '<h1>foo bar</h1>';

$filesystem->shouldReceive('exists')->with(Hyde::path('resources/includes/'.$filename))->andReturn(true);
$filesystem->shouldReceive('get')->with(Hyde::path('resources/includes/'.$filename))->andReturn($content);
});
Expand All @@ -117,6 +117,7 @@ public function testMarkdownReturnsRenderedPartial()

$this->mockFilesystem(function ($filesystem) use ($filename) {
$content = '# foo bar';

$filesystem->shouldReceive('exists')->with(Hyde::path('resources/includes/'.$filename))->andReturn(true);
$filesystem->shouldReceive('get')->with(Hyde::path('resources/includes/'.$filename))->andReturn($content);
});
Expand Down Expand Up @@ -145,6 +146,7 @@ public function testMarkdownWithAndWithoutExtension()
$this->mockFilesystem(function ($filesystem) {
$content = '# foo bar';
$filename = 'foo.md';

$filesystem->shouldReceive('exists')->with(Hyde::path('resources/includes/'.$filename))->andReturn(true);
$filesystem->shouldReceive('get')->with(Hyde::path('resources/includes/'.$filename))->andReturn($content);
});
Expand All @@ -161,6 +163,7 @@ public function testBladeReturnsRenderedPartial()

$this->mockFilesystem(function ($filesystem) use ($expected, $filename) {
$content = '{{ "foo bar" }}';

$filesystem->shouldReceive('exists')->with(Hyde::path('resources/includes/'.$filename))->andReturn(true);
$filesystem->shouldReceive('get')->with(Hyde::path('resources/includes/'.$filename))->andReturn($content);

Expand All @@ -172,11 +175,11 @@ public function testBladeReturnsRenderedPartial()

public function testBladeWithAndWithoutExtension()
{

$this->mockFilesystem(function ($filesystem) {
$expected = 'foo bar';
$content = '{{ "foo bar" }}';
$filename = 'foo.blade.php';

$filesystem->shouldReceive('exists')->with(Hyde::path('resources/includes/'.$filename))->andReturn(true);
$filesystem->shouldReceive('get')->with(Hyde::path('resources/includes/'.$filename))->andReturn($content);

Expand All @@ -194,6 +197,7 @@ public function testBladeReturnsDefaultValueWhenNotFound()

$this->mockFilesystem(function ($filesystem) use ($default, $expected, $filename) {
$filesystem->shouldReceive('exists')->with(Hyde::path('resources/includes/'.$filename))->andReturn(false);

Blade::shouldReceive('render')->with($default)->andReturn($expected);
});

Expand Down

0 comments on commit 990a561

Please sign in to comment.