[wp-trac] [WordPress Trac] #5210: Refactor plugin (de)activation code for unit testing

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 16 01:59:20 GMT 2007


#5210: Refactor plugin (de)activation code for unit testing
-------------------------+--------------------------------------------------
 Reporter:  Quandary     |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  normal       |   Milestone:  2.4      
Component:  General      |     Version:           
 Severity:  normal       |    Keywords:           
-------------------------+--------------------------------------------------
 To perform unit tests involving plugin (de)activation, it is currently
 necessary to either duplicate or indirectly call the logic in wp-
 admin/plugins.php. The code additionally duplicates itself (there is
 separate logic for deactivating one and deactivating all plugins). The
 attached patch moves the activating, deactivating, and deactivating all
 out into separate functions, which should allow for easier testing.

 It may or may not be appropriate to break out the plugin inclusion code in
 wp-settings.php into its own function. The inclusion action is performed
 by the original wp-admin/plugins.php code, as well as the refactored code,
 so it's not strictly necessary with the current setup for the plugin
 activation code to be called once the plugin has been activated. This
 patch makes the smaller change, and does not break out the wp-settings.php
 code.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/5210>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list