3da1db1ccc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMultiCity\Tests;
|
|
|
|
use WPMultiCity\Plugin;
|
|
|
|
final class PluginBootS4Test extends TestCase
|
|
{
|
|
public function test_boot_wires_s4_registrations(): void
|
|
{
|
|
if (!class_exists('ACF', false)) {
|
|
eval('class ACF {}');
|
|
}
|
|
|
|
$plugin = Plugin::instance();
|
|
$reflection = new \ReflectionClass($plugin);
|
|
$prop = $reflection->getProperty('booted');
|
|
$prop->setValue($plugin, false);
|
|
|
|
$plugin->boot();
|
|
|
|
self::assertNotFalse(
|
|
has_action('acf/init', ['WPMultiCity\\OptionsPage', 'do_register']),
|
|
'boot() must register OptionsPage on acf/init'
|
|
);
|
|
self::assertNotFalse(
|
|
has_action('acf/init', ['WPMultiCity\\TermMeta', 'do_register']),
|
|
'boot() must register TermMeta on acf/init'
|
|
);
|
|
self::assertSame(
|
|
9999,
|
|
has_action('wp', ['WPMultiCity\\Router', 'route']),
|
|
'boot() must register Router on wp@9999'
|
|
);
|
|
self::assertSame(
|
|
9998,
|
|
has_action('wp', ['WPMultiCity\\Redirect', 'handle']),
|
|
'boot() must register Redirect on wp@9998'
|
|
);
|
|
}
|
|
}
|