43815dea2d
tests / phpunit (push) Has been cancelled
- PluginBootS7Test idempotency: assertTrue(class_exists) instead of assertTrue(true) - ZipArchiveBuildTest: try/finally cleanup + unzip exit-code check - bootstrap.php: drop unused PUC shims (wp_remote_post, transient*) - CHANGELOG.md: header references Keep a Changelog (was: mirrors readme.txt) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
50 lines
1.2 KiB
PHP
50 lines
1.2 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(
|
|
class_exists('YahnisElsts\\PluginUpdateChecker\\v5\\PucFactory'),
|
|
'PucFactory must still be loaded after double boot()'
|
|
);
|
|
}
|
|
}
|