feat(wpmc S3): procedural wpmc_* API + smoke test

Also fixes PluginBootTest to be order-independent (reset booted flag)
and to expect ShortcodeDmr hook that boot() now wires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vladimir Bryzgalov
2026-05-12 20:11:47 +05:00
parent 3dbca34234
commit d8b0d01f1c
4 changed files with 60 additions and 1 deletions
+14 -1
View File
@@ -14,7 +14,13 @@ final class PluginBootTest extends TestCase
eval('class ACF {}');
}
Plugin::instance()->boot();
// Reset booted flag so this test is order-independent.
$plugin = Plugin::instance();
$reflection = new \ReflectionClass($plugin);
$prop = $reflection->getProperty('booted');
$prop->setValue($plugin, false);
$plugin->boot();
self::assertNotFalse(
has_action('init', ['WPMultiCity\\Taxonomy', 'do_register']),
@@ -28,6 +34,10 @@ final class PluginBootTest extends TestCase
has_action('acf/init', ['WPMultiCity\\FieldGroup', 'do_register']),
'boot() must register FieldGroup on acf/init'
);
self::assertNotFalse(
has_action('init', ['WPMultiCity\\ShortcodeDmr', 'do_register']),
'boot() must register ShortcodeDmr on init'
);
}
public function test_boot_is_idempotent_when_called_multiple_times(): void
@@ -55,6 +65,9 @@ final class PluginBootTest extends TestCase
\Brain\Monkey\Actions\expectAdded('acf/init')
->with([\WPMultiCity\FieldGroup::class, 'do_register'])
->once();
\Brain\Monkey\Actions\expectAdded('init')
->with([\WPMultiCity\ShortcodeDmr::class, 'do_register'])
->once();
$plugin->boot();
$plugin->boot();