feat: change log table with retention cron and limits option
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit;
|
||||
|
||||
use Brain\Monkey\Functions;
|
||||
use LIT\MCP\Lifecycle;
|
||||
use Mockery;
|
||||
|
||||
final class LifecycleTest extends TestCase
|
||||
{
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($GLOBALS['wpdb']);
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
public function testActivateInstallsTheTableAndSchedulesTheCleanup(): void
|
||||
{
|
||||
$GLOBALS['wpdb'] = Mockery::mock(\wpdb::class)->makePartial();
|
||||
Functions\expect('dbDelta')->once();
|
||||
Functions\expect('update_option')->once()->with('lit_mcp_db_version', '1');
|
||||
Functions\when('wp_next_scheduled')->justReturn(false);
|
||||
Functions\expect('wp_schedule_event')->once();
|
||||
|
||||
Lifecycle::activate();
|
||||
}
|
||||
|
||||
public function testDeactivateUnschedulesTheCleanup(): void
|
||||
{
|
||||
Functions\expect('wp_clear_scheduled_hook')->once()->with('lit_mcp_log_cleanup');
|
||||
|
||||
Lifecycle::deactivate();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user