Requirement, Call, ConstantRequirement, Mirror, Problem, FeatureStatus, CompatibilityMatrix, Manifest, ManifestCheck sowie Fingerprints und LineDiff liegen jetzt im divi-freien Kern. Neu: GlobalRequirement, CompatibilityMatrix::fromProblems(), ManifestCheck-Option signatures, DiviManifestCheck::create() und DiviAreas. Divi-Verhalten unverändert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.5 KiB
PHP
47 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Tests\Unit\Integrations\Divi\Design;
|
|
|
|
use Brain\Monkey\Functions;
|
|
use LIT\MCP\Integrations\Divi\Design\DesignSystemReader;
|
|
use LIT\MCP\Compatibility\Call;
|
|
use LIT\MCP\Integrations\Divi\Release\DiviAdapters;
|
|
use LIT\MCP\Integrations\Divi\Release\DiviAreas;
|
|
use LIT\MCP\Tests\Unit\TestCase;
|
|
|
|
final class DesignSystemReaderTest extends TestCase
|
|
{
|
|
public function testIsTheRegisteredDesignAdapter(): void
|
|
{
|
|
$manifest = DesignSystemReader::manifest();
|
|
|
|
self::assertContains(DesignSystemReader::class, DiviAdapters::CLASSES);
|
|
self::assertSame(DiviAreas::DESIGN, $manifest->area);
|
|
self::assertSame(
|
|
['GlobalData::get_global_colors()', 'GlobalData::get_global_variables()',
|
|
'GlobalPreset::get_data()'],
|
|
array_map(static fn (Call $call): string => $call->label(), $manifest->calls)
|
|
);
|
|
self::assertSame(['et_divi'], $manifest->keys);
|
|
}
|
|
|
|
public function testDiviLogoReadsTheThemeOptions(): void
|
|
{
|
|
Functions\when('get_option')->alias(
|
|
static fn (string $name): mixed => $name === 'et_divi' ?
|
|
['divi_logo' => 'https://k.de/logo.svg'] : false
|
|
);
|
|
|
|
self::assertSame('https://k.de/logo.svg', DesignSystemReader::diviLogo());
|
|
}
|
|
|
|
public function testDiviLogoIsEmptyWithoutOptions(): void
|
|
{
|
|
Functions\when('get_option')->justReturn(false);
|
|
|
|
self::assertSame('', DesignSystemReader::diviLogo());
|
|
}
|
|
}
|