1.7 KiB
1.7 KiB
Plugin Lifecycle Test Cases
Purpose
Verify activation, deactivation, and removal semantics, including table cleanup behavior controlled from Setup (uninstall_cleanup_mode).
Preconditions
- Run on a disposable/staging WordPress environment.
- Plugin package installed but tests may deactivate/remove plugin.
- Record current value of
calendar_plugin_uninstall_cleanup_mode.
LIF-001 First-Time Activation
- Steps:
- Ensure plugin is not active.
- Activate plugin.
- Open Setup page once.
- Assertions:
- Activation succeeds without fatal errors.
- Required plugin tables exist (
*_events,*_recurrence_exceptions,*_users,*_user_tokens,*_audit_log). - Default setup values exist, including
uninstall_cleanup_mode=keep.
LIF-002 Deactivation (No Data Loss)
- Steps:
- Seed at least one event and one user.
- Deactivate plugin.
- Re-activate plugin.
- Assertions:
- Deactivation does not drop plugin tables.
- Seeded data remains available after re-activation.
LIF-003 Removal With Keep Mode
- Steps:
- Set Setup -> Uninstall Cleanup =
keep. - Remove/delete plugin from WordPress.
- Re-install and activate plugin.
- Set Setup -> Uninstall Cleanup =
- Assertions:
- Plugin-owned tables are preserved.
- Existing plugin data remains.
LIF-004 Removal With Remove Mode
- Steps:
- Set Setup -> Uninstall Cleanup =
remove. - Remove/delete plugin from WordPress.
- Inspect database.
- Set Setup -> Uninstall Cleanup =
- Assertions:
- Plugin-owned tables are dropped.
- Plugin-owned options are removed.
- No non-plugin tables are affected.
LIF-005 Idempotence/Safety
- Steps:
- Run remove flow twice in
removemode.
- Run remove flow twice in
- Assertions:
- No fatal errors on repeated cleanup.
- Cleanup remains scoped to plugin-owned objects only.