Skip to content

Commit

Permalink
Update test for new implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Dec 6, 2024
1 parent 5e7d679 commit 21c6689
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@
use Hyde\Markdown\Contracts\MarkdownShortcodeContract;
use Hyde\Markdown\Processing\ShortcodeProcessor;
use Hyde\Testing\UnitTestCase;
use Hyde\Testing\UsesRealBladeInUnitTests;

/**
* @covers \Hyde\Markdown\Processing\ShortcodeProcessor
*/
class ShortcodeProcessorTest extends UnitTestCase
{
use UsesRealBladeInUnitTests;

protected static bool $needsKernel = true;
protected static bool $needsConfig = true;

protected function setUp(): void
{
self::mockCurrentRouteKey('foo');
$this->createRealBladeCompilerEnvironment();
}

public function testConstructorDiscoversDefaultShortcodes()
Expand All @@ -33,7 +37,11 @@ public function testDiscoveredShortcodesAreUsedToProcessInput()
{
$processor = new ShortcodeProcessor('>info foo');

$this->assertSame('<blockquote class="info"><p>foo</p></blockquote>', $processor->run());
$this->assertSame(<<<'HTML'
<blockquote class="info">
<p>foo</p>
</blockquote>
HTML, $processor->run());
}

public function testStringWithoutShortcodeIsNotModified()
Expand All @@ -46,8 +54,11 @@ public function testStringWithoutShortcodeIsNotModified()
public function testProcessStaticShorthand()
{
$this->assertSame(
'<blockquote class="info"><p>foo</p></blockquote>',
ShortcodeProcessor::preprocess('>info foo')
<<<'HTML'
<blockquote class="info">
<p>foo</p>
</blockquote>
HTML, ShortcodeProcessor::preprocess('>info foo')
);
}

Expand Down

0 comments on commit 21c6689

Please sign in to comment.