function ib_edu_update_check() { if (get_option('ib_educator_version') != IBEDUCATOR_VERSION) { $install = new Edr_Install(); $install->activate(false, false); } }
public function testUpdateSplittedTerms() { // Remove split_shared_term to prevent automatic categories update for memberships. remove_action('split_shared_term', array('IB_Educator_Main', 'split_shared_term')); // Split shared term. $new_term = wp_update_term($this->terms['term3']['term_id'], 'ib_educator_category', array('name' => 'Edu')); // Update shared terms for use in memberships. $install = new Edr_Install(); $install->update_1_4_4(); $ms = Edr_Memberships::get_instance(); $meta = $ms->get_membership_meta($this->posts[0]); // The term_id stored in the membership's categories setting should be updated. $this->assertEquals(array($new_term['term_id'], $this->terms['term4']['term_id']), $meta['categories']); }
<?php $_tests_dir = getenv('WP_TESTS_DIR'); if (!$_tests_dir) { $_tests_dir = '/tmp/wordpress-tests-lib'; } require_once $_tests_dir . '/includes/functions.php'; function _manually_load_plugin() { // Set plugin options. update_option('ib_educator_learning', array('lesson_comments' => 1)); require dirname(__FILE__) . '/../../ibeducator.php'; } tests_add_filter('muplugins_loaded', '_manually_load_plugin'); require $_tests_dir . '/includes/bootstrap.php'; /* CUSTOM */ require dirname(__FILE__) . '/ib-educator-tests.php'; // Activate and setup the plugin. activate_plugin('ibeducator/ibeducator.php'); require_once IBEDUCATOR_PLUGIN_DIR . 'includes/Edr/Install.php'; $edr_install = new Edr_Install(); $edr_install->activate();
/** * Install plugins. */ public function install_plugins() { // Educator. $install = new Edr_Install(); $install->activate(); }
/** * Plugin deactivation hook. */ public static function plugin_deactivation() { $install = new Edr_Install(); $install->deactivate(); }