Files
WP-LIT-MCP/tests/Unit/Integrations/Divi/Schema/ShortformCheckTest.php
T
2026-09-30 02:21:09 +02:00

32 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace LIT\MCP\Tests\Unit\Integrations\Divi\Schema;
use LIT\MCP\Integrations\Divi\Schema\ModuleCatalog;
use LIT\MCP\Integrations\Divi\Schema\ShortformCheck;
use LIT\MCP\Integrations\Divi\Schema\ShortformMap;
use LIT\MCP\Tests\Support\DiviFixtures;
use PHPUnit\Framework\TestCase;
final class ShortformCheckTest extends TestCase
{
public function testAnEmptyCatalogKnowsNoShortformModule(): void
{
$problems = ShortformCheck::problems(new ModuleCatalog([]));
self::assertCount(count(ShortformMap::types()), $problems);
self::assertContains('divi/text: unbekanntes Modul', $problems);
}
/** The fixture catalog (metadata-sample.json) lacks some modules, but every path of the modules it has is right. */
public function testFixtureCatalogHasNoWrongPathsOrChildren(): void
{
foreach (ShortformCheck::problems(DiviFixtures::catalog()) as $problem) {
self::assertStringEndsWith(': unbekanntes Modul', $problem);
}
self::assertNotContains('divi/text: unbekanntes Modul', ShortformCheck::problems(DiviFixtures::catalog()));
}
}