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
@@ -4,8 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit\Integrations\Core;
|
||||
|
||||
use Brain\Monkey\Functions;
|
||||
use LIT\MCP\Integrations\Core\CoreIntegration;
|
||||
use LIT\MCP\Integrations\Core\EnvironmentComponent;
|
||||
use LIT\MCP\Tests\Unit\TestCase;
|
||||
use WP_User;
|
||||
|
||||
final class CoreIntegrationTest extends TestCase
|
||||
{
|
||||
@@ -20,4 +23,23 @@ final class CoreIntegrationTest extends TestCase
|
||||
array_map(static fn ($a) => $a->name(), $core->abilities())
|
||||
);
|
||||
}
|
||||
|
||||
public function testSiteStatusReportsTheComponentsOfTheIntegrations(): void
|
||||
{
|
||||
Functions\when('get_bloginfo')->justReturn('x');
|
||||
Functions\when('home_url')->justReturn('https://kunde.de');
|
||||
Functions\when('wp_get_current_user')->justReturn(new WP_User(3, ['editor']));
|
||||
Functions\when('get_option')->justReturn(['editor']);
|
||||
$component = new class implements EnvironmentComponent {
|
||||
public function describe(): array
|
||||
{
|
||||
return ['id' => 'builder', 'active' => true, 'version' => '9', 'problems' => [], 'release' => null];
|
||||
}
|
||||
};
|
||||
$core = new CoreIntegration(dirname(__DIR__, 3) . '/Fixtures/guides', [$component]);
|
||||
|
||||
$status = $core->abilities()[1]->execute([]);
|
||||
|
||||
self::assertSame(['builder', 'pods', 'the-events-calendar'], array_column($status['components'], 'id'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user