Initial baseline: LaraBlog core with plugin commerce surface.

Captures the current working tree after theme slots, ArticleAccess, and the payment / paid-content plugins so subsequent work has a reviewable git history.
This commit is contained in:
ak
2026-08-12 01:15:38 +08:00
commit 263b98b218
337 changed files with 31393 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace Tests\Unit;
use App\Domain\Blog\ContentFormat;
use App\Domain\Blog\ContentRenderer;
use Tests\TestCase;
class ContentRendererTest extends TestCase
{
public function test_markdown_renders_to_html(): void
{
$html = app(ContentRenderer::class)->toHtml("# Hello\n\n**world**", ContentFormat::MARKDOWN);
$this->assertMatchesRegularExpression('/<h1[^>]*>Hello<\/h1>/', $html);
$this->assertStringContainsString('<strong>world</strong>', $html);
}
public function test_html_format_passes_through_purifier(): void
{
$html = app(ContentRenderer::class)->toHtml(
'<p>ok</p><script>alert(1)</script>',
ContentFormat::HTML,
);
$this->assertStringContainsString('<p>ok</p>', $html);
$this->assertStringNotContainsString('<script>', $html);
}
public function test_html_to_markdown_roundtrip_basic(): void
{
$md = app(ContentRenderer::class)->htmlToMarkdown('<h2>Title</h2><p>Hello <strong>x</strong></p>');
$this->assertStringContainsString('Title', $md);
$this->assertStringContainsString('Hello', $md);
}
}