Skip to content

Commit

Permalink
Merge pull request #152 from hydephp/147-add-test-for-packagesframewo…
Browse files Browse the repository at this point in the history
…rksrccommandshydepackagediscovercommandphp

Add test for ConvertsFooterMarkdown.php
  • Loading branch information
caendesilva authored Jul 3, 2022
2 parents 0b10e09 + 96448f2 commit ca13495
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/framework/src/Actions/ConvertsFooterMarkdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*
* Tries to convert the Markdown text if supplied in the config,
* otherwise, it falls back to a default string.
*
* @see \Hyde\Framework\Testing\Unit\ConvertsFooterMarkdownTest
*/
class ConvertsFooterMarkdown
{
Expand Down
22 changes: 22 additions & 0 deletions packages/framework/tests/Unit/ConvertsFooterMarkdownTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Hyde\Framework\Testing\Unit;

use Hyde\Framework\Actions\ConvertsFooterMarkdown;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Framework\Actions\ConvertsFooterMarkdown
*/
class ConvertsFooterMarkdownTest extends TestCase
{
public function test_execute_method_renders_config_defined_markdown_to_html()
{
config(['hyde.footer.markdown' => '# Foo bar']);

$this->assertEquals(
"<h1>Foo bar</h1>\n",
ConvertsFooterMarkdown::execute()
);
}
}

0 comments on commit ca13495

Please sign in to comment.