feat: manifest checks, Divi compatibility from manifests, reference fingerprints
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,10 @@ declare(strict_types=1);
|
||||
namespace LIT\MCP\Tests\Unit\Integrations\Divi;
|
||||
|
||||
use LIT\MCP\Integrations\Divi\DiviCompatibility;
|
||||
use LIT\MCP\Integrations\Divi\Release\Call;
|
||||
use LIT\MCP\Integrations\Divi\Release\Manifest;
|
||||
use LIT\MCP\Integrations\Divi\Release\ManifestCheck;
|
||||
use LIT\MCP\Integrations\Divi\Release\Mirror;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use RuntimeException;
|
||||
|
||||
@@ -23,34 +27,35 @@ final class DiviCompatibilityTest extends TestCase
|
||||
self::assertSame(['B', 'C'], $compatibility->problems());
|
||||
}
|
||||
|
||||
public function testDefaultsCoverTheDiviInternalsInUse(): void
|
||||
public function testDefaultsAreCodeRegistrationsAndFingerprints(): void
|
||||
{
|
||||
$check = new ManifestCheck(
|
||||
['X' => new Manifest(
|
||||
Manifest::LIBRARY,
|
||||
calls: [new Call('strlen', 1)],
|
||||
postTypes: ['et_pb_layout'],
|
||||
mirrors: [new Mirror('m', 'a.php', 'a', null, 'Terme')]
|
||||
)],
|
||||
[],
|
||||
static fn (): ?string => null,
|
||||
static fn (): bool => true
|
||||
);
|
||||
|
||||
self::assertSame(
|
||||
[
|
||||
'ModuleRegistration (Modul-Katalog)',
|
||||
'DynamicContentOptions (Dynamic Content)',
|
||||
'et_pb_is_allowed (Divi-Rollen)',
|
||||
'Post-Typ et_pb_layout (Bibliothek)',
|
||||
'Taxonomien scope, layout_type, module_width (Bibliothek)',
|
||||
'GlobalLayout::is_global_layout_template (globale Module)',
|
||||
'ET_Core_PageResource (CSS-Cache)',
|
||||
'Block-Typ divi/global-layout (Instanzen globaler Module)',
|
||||
'Taxonomien layout_category, layout_tag (Bibliothek)',
|
||||
'Theme Builder: Funktionen et_theme_builder_* und et_()',
|
||||
'Theme Builder: Post-Typen et_template und Layouts',
|
||||
],
|
||||
array_keys(DiviCompatibility::defaults())
|
||||
['Bibliothek: strlen()', 'Bibliothek: Post-Typ et_pb_layout', 'Bibliothek: Nachbau von a() – Terme'],
|
||||
array_keys(DiviCompatibility::defaults($check))
|
||||
);
|
||||
}
|
||||
|
||||
/** Review M-2: et_theme_builder_clear_wp_cache is one of DiviThemeBuilder::FUNCTIONS – reported once. */
|
||||
public function testChecksTheThemeBuilderInternals(): void
|
||||
public function testRealDefaultsCoverEveryAdapterArea(): void
|
||||
{
|
||||
$labels = array_keys(DiviCompatibility::defaults());
|
||||
$labels = implode("\n", array_keys(DiviCompatibility::defaults()));
|
||||
|
||||
self::assertNotContains('et_theme_builder_clear_wp_cache (Theme-Builder-Cache)', $labels);
|
||||
|
||||
self::assertContains('Theme Builder: Funktionen et_theme_builder_* und et_()', $labels);
|
||||
self::assertContains('Theme Builder: Post-Typen et_template und Layouts', $labels);
|
||||
$areas = [Manifest::PAGES, Manifest::LIBRARY, Manifest::THEME_BUILDER, Manifest::DESIGN, Manifest::CATALOG];
|
||||
foreach ($areas as $area) {
|
||||
self::assertStringContainsString($area . ': ', $labels);
|
||||
}
|
||||
self::assertStringContainsString('Theme Builder: Nachbau von et_theme_builder_api_save()', $labels);
|
||||
self::assertStringContainsString('Katalog: Block-Typ divi/global-layout', $labels);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user