time() + 3600, 'schedule' => 'weekly' ]; // Verify pre-uninstall state. $this->assertNotFalse( get_option( 'prv_models' ) ); $this->assertNotFalse( get_option( 'prv_monthly_budget_usd' ) ); $this->assertNotFalse( get_option( 'prv_api_key_status' ) ); $this->assertNotFalse( get_option( 'prv_active_config_version' ) ); $this->assertNotFalse( get_transient( PRV_Run_Lock::LOCK_KEY ) ); $this->assertTrue( PRV_Cron::is_scheduled() ); // Simulate uninstall: delete all prv_ options. $keys_to_purge = array_filter( array_keys( $GLOBALS['prv_test_state']['options'] ), static fn( $k ) => str_starts_with( $k, 'prv_' ) ); foreach ( $keys_to_purge as $k ) { unset( $GLOBALS['prv_test_state']['options'][ $k ] ); } delete_transient( PRV_Run_Lock::LOCK_KEY ); wp_clear_scheduled_hook( PRV_CRON_HOOK ); // Verify all prv_ options are gone. $this->assertFalse( get_option( 'prv_models' ) ); $this->assertFalse( get_option( 'prv_monthly_budget_usd' ) ); $this->assertFalse( get_option( 'prv_api_key_status' ) ); $this->assertFalse( get_option( 'prv_active_config_version' ) ); $this->assertFalse( get_option( 'prv_config_versions' ) ); $this->assertFalse( get_option( 'prv_models_schema_version' ) ); $this->assertFalse( get_option( 'prv_schema_version' ) ); $this->assertFalse( get_option( 'prv_provider_key_enc' ) ); $this->assertFalse( get_option( 'prv_last_run_truncated' ) ); $this->assertFalse( get_transient( PRV_Run_Lock::LOCK_KEY ) ); $this->assertFalse( PRV_Cron::is_scheduled() ); } }