skorupa Posted July 30, 2013 Share Posted July 30, 2013 Hi, I am writing next version of my module, and want to do some update in database. My plugin is published in Addons so it will get the benefit of autoupdating. I found this article: http://doc.prestashop.com/display/PS15/Auto-updating+modules but my problem now is: How To Test It. Very simple thing, yet I can't find any info how to do it. If any one found solution to this problem or have some good tips how to do it I would appreciate very much. Link to comment Share on other sites More sharing options...
skorupa Posted August 27, 2013 Author Share Posted August 27, 2013 Has anybody any expirience with module auto-update, how to test it etc. Link to comment Share on other sites More sharing options...
bellini13 Posted August 27, 2013 Share Posted August 27, 2013 are you saying you want to test the function that notifies merchants that there is a new update? Or do you want to test that the module is installed and upgraded properly? Link to comment Share on other sites More sharing options...
skorupa Posted August 27, 2013 Author Share Posted August 27, 2013 Secod option. I want to test module update scenario, and check do my module updates correctly. Link to comment Share on other sites More sharing options...
bellini13 Posted August 27, 2013 Share Posted August 27, 2013 You can do that locally. Install the old version of the module, and then install the new version of the module and confirm that your upgrade procedures work properly. Link to comment Share on other sites More sharing options...
cfillol Posted November 14, 2014 Share Posted November 14, 2014 What I do is to call all upgrade scripts from the module install method. So I can test the full upgrade process when I do a normal installation. I'm not sure if this is the oficial way, but it seems to work. public function install() { if (!parent::install()) return false; // In this exemple 1.1.2 is the current version of the module // and the others are previous versions. $versions = array('1.0.0', '1.1.0', '1.1.2'); foreach ($versions as $ver) { include(dirname(__FILE__).'/upgrade/install-'.$ver.'.php'); $upgrade_func = 'upgrade_module_'.str_replace('.', '_', $ver); if (!$upgrade_func($this)) return false; } return true; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now