id()); self::assertTrue($core->isAvailable()); self::assertSame( ['lit/guide', 'lit/site-status'], 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', static fn (): array => [$component]); $status = $core->abilities()[1]->execute([]); self::assertSame(['builder', 'the-events-calendar'], array_column($status['components'], 'id')); } }