e2399e2360
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 lines
956 B
PHP
33 lines
956 B
PHP
<?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'
|
|
);
|
|
}
|
|
}
|