ids() ); } /** Only the Divi integration has boot steps; a second boot registers nothing twice. */ public function testTheBootableIntegrationsBootExactlyOnce(): void { Actions\expectAdded('upgrader_process_complete')->once(); Actions\expectAdded('rest_api_init')->once(); Filters\expectAdded(SettingsPage::TABS_FILTER)->once(); $registry = self::registry(); $registry->boot(); $registry->boot(); } /** * No temporal coupling: building and booting the integrations never asks the Tools-tab state (an unbound * ToolAvailability throws when asked); bound afterwards, it answers from the bound policy. */ public function testTheToolsTabStateIsAskedOnlyAfterBind(): void { Functions\stubTranslationFunctions(); $tools = new ToolAvailability(); $registry = self::registry($tools); $registry->boot(); $tools->bind($registry, new ExposurePolicy(['@group:divi-library' => ExposurePolicy::DISABLED])); self::assertFalse($tools->groupEnabled('divi-library')); self::assertTrue($tools->groupWritable('divi-theme-builder')); self::assertFalse($tools->allows('lit/divi-insert'), 'no Divi in unit tests: lit/divi-insert not registered'); } }