hasComposition()

* renderRegion()
* draft and published-state handling
* document and placement scheduling
* disabled-placement filtering
* ordered region rendering
* safe fallback when composition tables or document views are missing
* compatibility with common alternative column names
This commit is contained in:
Mark Gregory
2026-07-27 09:43:42 +01:00
parent a211b10e29
commit c972808d0a
22 changed files with 455 additions and 754 deletions
@@ -0,0 +1,11 @@
<?php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Modules\Content\Models\ContentDocument;
use Modules\Content\Models\ContentType;
use Modules\Content\Services\PageRenderer;
uses(RefreshDatabase::class);
it('registers the renderer', function(){ expect(app(PageRenderer::class))->toBeInstanceOf(PageRenderer::class); });
it('stores structured document data', function(){ $type=ContentType::create(['key'=>'test','name'=>'Test','schema'=>[]]); $doc=ContentDocument::create(['content_type_id'=>$type->id,'title'=>'Test','slug'=>'test','status'=>'draft','data'=>['title'=>'Hello']]); expect($doc->fresh()->data)->toBe(['title'=>'Hello']); });