refactor: Kern ohne Divi – Ports BuilderDetector, MediaUsageSource, EnvironmentComponent und ausgeschlossene Post-Typen im ContentSchema; Divi-Implementierungen und Verdrahtung über DiviIntegration/Plugin; CoreIndependenceTest
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
abeb4b0eed
commit
06148fb8c1
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit\Integrations\Divi;
|
||||
|
||||
use Brain\Monkey\Functions;
|
||||
use LIT\MCP\Integrations\Divi\DiviBuilderDetector;
|
||||
use LIT\MCP\Integrations\WordPress\BuilderDetector;
|
||||
use LIT\MCP\Tests\Unit\TestCase;
|
||||
|
||||
final class DiviBuilderDetectorTest extends TestCase
|
||||
{
|
||||
public function testIsABuilderDetectorThatFollowsDiviFiveBeingLoaded(): void
|
||||
{
|
||||
$detector = new DiviBuilderDetector();
|
||||
|
||||
self::assertInstanceOf(BuilderDetector::class, $detector);
|
||||
self::assertFalse($detector->isAvailable(), 'no Divi classes in unit tests');
|
||||
}
|
||||
|
||||
public function testALayoutIsMarkedByDivisBuilderFlag(): void
|
||||
{
|
||||
Functions\when('get_post_meta')->alias(
|
||||
static fn (int $postId, string $key): string => $postId === 7 && $key === '_et_pb_use_builder' ? 'on' : ''
|
||||
);
|
||||
$detector = new DiviBuilderDetector();
|
||||
|
||||
self::assertTrue($detector->usesBuilder(7));
|
||||
self::assertFalse($detector->usesBuilder(8));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user