feat(wpmc S3): Plugin::boot() wires ShortcodeDmr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@ final class Plugin
|
|||||||
Taxonomy::register();
|
Taxonomy::register();
|
||||||
PostType::register();
|
PostType::register();
|
||||||
FieldGroup::register();
|
FieldGroup::register();
|
||||||
|
ShortcodeDmr::register();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function dependencies_satisfied(): bool
|
private function dependencies_satisfied(): bool
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace WPMultiCity\Tests;
|
||||||
|
|
||||||
|
use WPMultiCity\Plugin;
|
||||||
|
|
||||||
|
final class PluginBootShortcodeDmrTest extends TestCase
|
||||||
|
{
|
||||||
|
public function test_boot_attaches_shortcode_dmr_init_action(): 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('init', ['WPMultiCity\\ShortcodeDmr', 'do_register']),
|
||||||
|
'boot() must register ShortcodeDmr on init'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user