Is there a way to test run a theme through the automatic updater?
We have a theme where a version will introduce new functionality which might break existing themes. I would like to check previous theme version upon upgrade and include some upgrade-specific code if the upgrade is between two certain versions.
I first thought I could use after_theme_switch
hook, but the theme is mainly used as parent theme and will probably be upgraded while not being the active theme. I have looked into using upgrader_pre_install
and upgrader_post_install
hooks, but how to I test these?
The ultimate would be to have it as a unit test, but any other way to mock-upgrade would be great. Uploading a zip file is treated as an install and not upgrade.
Is this even possible from within a theme, our should I look into writing a mock-upgrade plugin?