makePartial(); $db->expects('query')->twice()->with('DROP TABLE IF EXISTS wp_lit_mcp_log'); $GLOBALS['wpdb'] = $db; Functions\when('is_multisite')->justReturn(true); Functions\when('get_sites')->justReturn([1, 2]); Functions\expect('switch_to_blog')->twice(); Functions\expect('restore_current_blog')->twice(); Functions\expect('delete_transient')->twice()->with(ConnectionStatus::ENDPOINT_TRANSIENT); Functions\expect('wp_clear_scheduled_hook')->twice()->with(ChangeLogCleanup::HOOK); Functions\expect('delete_metadata')->once()->with('user', 0, 'lit_mcp_log_per_page', '', true); $deleted = []; Functions\when('delete_option')->alias(static function (string $option) use (&$deleted): bool { $deleted[] = $option; return true; }); require dirname(__DIR__, 2) . '/uninstall.php'; $own = [Access::OPTION, ExposurePolicy::OPTION, Limits::OPTION, ChangeLogInstaller::VERSION_OPTION]; self::assertSame(array_merge($own, $own), $deleted); self::assertNotContains('mcp_jwt_secret', $deleted); self::assertNotContains('wpmedia_mcp_oauth_rewrite_version', $deleted); } }