feat(wpmc S7): Plugin::register_update_checker wires PUC v5.6
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WPMultiCity\Tests;
|
||||
|
||||
use Brain\Monkey\Functions;
|
||||
use ReflectionClass;
|
||||
use WPMultiCity\Plugin;
|
||||
|
||||
final class PluginBootS7Test extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$plugin = Plugin::instance();
|
||||
$reflection = new ReflectionClass($plugin);
|
||||
$prop = $reflection->getProperty('booted');
|
||||
$prop->setValue($plugin, false);
|
||||
}
|
||||
|
||||
public function test_boot_loads_puc_factory(): void
|
||||
{
|
||||
if (!class_exists('ACF', false)) {
|
||||
eval('class ACF {}');
|
||||
}
|
||||
|
||||
Plugin::instance()->boot();
|
||||
|
||||
self::assertTrue(
|
||||
class_exists('YahnisElsts\\PluginUpdateChecker\\v5\\PucFactory'),
|
||||
'boot() should require PUC loader and make PucFactory available'
|
||||
);
|
||||
}
|
||||
|
||||
public function test_boot_double_call_is_idempotent(): void
|
||||
{
|
||||
if (!class_exists('ACF', false)) {
|
||||
eval('class ACF {}');
|
||||
}
|
||||
|
||||
Plugin::instance()->boot();
|
||||
Plugin::instance()->boot();
|
||||
|
||||
self::assertTrue(true, 'Double boot must not throw');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user