Files
WP-LIT-MCP/tests/Unit/Integrations/Divi/DiviCompatibilityTest.php
T
janniclas.loosenandClaude Opus 5.5 5290a9d81d refactor: one site-wide Divi cache clear and one compatibility row (review M-1, M-2)
DiviSaver's site-wide scopes and the Theme Builder tools now share
DiviThemeBuilder::clearSiteCaches(), which clears the Theme Builder cache
even when ET_Core_PageResource is missing. lit-site-status no longer lists
et_theme_builder_clear_wp_cache twice: the Theme Builder functions row
covers it, and the post-type row uses DiviThemeBuilder::postTypes().

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
2026-09-27 23:07:57 +02:00

57 lines
2.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace LIT\MCP\Tests\Unit\Integrations\Divi;
use LIT\MCP\Integrations\Divi\DiviCompatibility;
use PHPUnit\Framework\TestCase;
use RuntimeException;
final class DiviCompatibilityTest extends TestCase
{
public function testListsFailedAndThrowingChecks(): void
{
$compatibility = new DiviCompatibility([
'A' => static fn (): bool => true,
'B' => static fn (): bool => false,
'C' => static function (): bool {
throw new RuntimeException('Divi changed');
},
]);
self::assertSame(['B', 'C'], $compatibility->problems());
}
public function testDefaultsCoverTheDiviInternalsInUse(): void
{
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())
);
}
/** Review M-2: et_theme_builder_clear_wp_cache is one of DiviThemeBuilder::FUNCTIONS – reported once. */
public function testChecksTheThemeBuilderInternals(): void
{
$labels = 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);
}
}