25d50912f6
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
47 lines
1.1 KiB
PHP
47 lines
1.1 KiB
PHP
<?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');
|
|
}
|
|
}
|