2declare(strict_types=1);
4require_once dirname(__DIR__) .
'/include/dbxKiCmsService.class.php';
7$assert =
static function (
bool $condition,
string $message) use (&
$failures):
void {
13$class =
new ReflectionClass(\
dbx\dbxKi\dbxKiCmsService::class);
18$fakeHero =
'<div class="position-relative"><img data-cms-media-id="166" src="index.php?dbx_mid=166">'
19 .
'<div class="position-absolute top-0 start-0 w-100 h-100"><h2>Eine Plattform</h2>'
20 .
'<p>Dieser umfangreiche Text liegt über dem Bild und bildet damit fälschlich einen Hero im normalen Inhalt nach.</p>'
21 .
'<a href="demo">Demo ansehen</a></div></div><p>Body</p>';
25}
catch (ReflectionException $error) {
27}
catch (Throwable $error) {
28 $cause = $error instanceof ReflectionException ? $error : ($error->getPrevious() ?: $error);
29 $rejected = str_contains($cause->getMessage(),
'CMS-Hero')
30 || str_contains($error->getMessage(),
'CMS-Hero');
32$assert(
$rejected,
'dbxKi accepts an inline fake Hero at the start of content.');
34$realHero =
'<div class="dbx-home-hero-copy"><h2>Eine Plattform</h2><p>Hero-Text ohne Inline-Bild.</p></div>'
35 .
'<hr class="dbx-cms-marker" data-dbx-marker="dbx:hero"><p>Body</p>';
39}
catch (Throwable $error) {
44$cardWithBadge =
'<div class="card position-relative"><img class="card-img-top" data-cms-media-id="42" src="index.php?dbx_mid=42">'
45 .
'<span class="position-absolute badge">Neu</span><div class="card-body"><p>Produkt</p></div></div>';
49}
catch (Throwable $error) {
64 'The dbxKi CMS contract does not document the native Hero workflow.'
68 fwrite(STDERR,
"FAIL\n- " . implode(
"\n- ",
$failures) .
"\n");
72echo
"OK dbxKi enforces the native CMS Hero workflow.\n";
DBX schema administration.