SuperCacheFeature, SuperCacheCompatibility (LockOnFailure, getestet 3.1.5, Version aus dem Plugin-Header) und SuperCacheIntegration ohne Tools. Der SuperCacheListener sammelt Änderungen über lit_mcp_changed und leert einmal am Request-Ende: einen Beitrag per wp_cache_post_edit, mehrere Beiträge oder seitenweite Änderungen per wp_cache_clear_cache (Multisite: eigener Blog). Komplett-Purges höchstens alle 30 s, mit genau einem Nachlauf per WP-Cron. Freigabe-Einträge leeren nichts. Uninstaller räumt Optionen, Transient und Cron-Hook ab; Reiter und lit-site-status zeigen das Profil automatisch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Tests\Unit\Integrations\SuperCache;
|
|
|
|
use LIT\MCP\Compatibility\ProvidesCompatibility;
|
|
use LIT\MCP\Integrations\Integration;
|
|
use LIT\MCP\Integrations\SuperCache\SuperCacheCompatibility;
|
|
use LIT\MCP\Integrations\SuperCache\SuperCacheIntegration;
|
|
use LIT\MCP\Tests\Unit\TestCase;
|
|
|
|
final class SuperCacheIntegrationTest extends TestCase
|
|
{
|
|
public function testIsAnIntegrationWithoutAbilitiesThatProvidesItsProfile(): void
|
|
{
|
|
$integration = new SuperCacheIntegration();
|
|
|
|
self::assertInstanceOf(Integration::class, $integration);
|
|
self::assertInstanceOf(ProvidesCompatibility::class, $integration);
|
|
self::assertSame('wpsc', $integration->id());
|
|
self::assertSame('WP Super Cache', $integration->label());
|
|
self::assertSame([], $integration->abilities());
|
|
self::assertEquals([SuperCacheCompatibility::profile()], $integration->compatibilities());
|
|
}
|
|
|
|
public function testIsAvailableOnlyWithSuperCache(): void
|
|
{
|
|
self::assertSame(defined('WPCACHEHOME'), (new SuperCacheIntegration())->isAvailable());
|
|
}
|
|
}
|