feat(wpmc S2): Plugin::boot() wires Taxonomy + PostType + FieldGroup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-12 17:53:58 +05:00
parent f859385761
commit e2399e2360
2 changed files with 35 additions and 1 deletions
+3 -1
View File
@@ -41,7 +41,9 @@ final class Plugin
return; return;
} }
// Stage 2-5 hooks register here. Stage 1 (skeleton) intentionally empty. Taxonomy::register();
PostType::register();
FieldGroup::register();
} }
private function dependencies_satisfied(): bool private function dependencies_satisfied(): bool
+32
View File
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace WPMultiCity\Tests;
use WPMultiCity\Plugin;
final class PluginBootTest extends TestCase
{
public function test_boot_attaches_init_and_acf_init_hooks_when_acf_present(): void
{
// Simulate ACF being active so boot() proceeds past the dependency guard.
if (!class_exists('ACF', false)) {
eval('class ACF {}');
}
Plugin::instance()->boot();
self::assertNotFalse(
has_action('init', ['WPMultiCity\\Taxonomy', 'do_register']),
'boot() must register Taxonomy on init'
);
self::assertNotFalse(
has_action('init', ['WPMultiCity\\PostType', 'do_register']),
'boot() must register PostType on init'
);
self::assertNotFalse(
has_action('acf/init', ['WPMultiCity\\FieldGroup', 'do_register']),
'boot() must register FieldGroup on acf/init'
);
}
}