install() public static method

Install WC.
public static install ( )
function _install_wc()
{
    WC_Install::install();
    update_option('woocommerce_calc_shipping', 'yes');
    // Needed for tests cart and shipping methods
    // reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
    $GLOBALS['wp_roles']->reinit();
}
Exemplo n.º 2
0
function _setup_theme()
{
    define('WP_UNINSTALL_PLUGIN', true);
    update_option('woocommerce_status_options', array('uninstall_data' => 1));
    include dirname(__FILE__) . '/../vendor/woocommerce/uninstall.php';
    WC_Install::install();
    $GLOBALS['wp_roles']->reinit();
    echo "Installing WooCommerce..." . PHP_EOL;
}
 public function setup()
 {
     update_option('woocommerce_taxjar-integration_settings', array('api_token' => $this->api_token, 'enabled' => 'yes', 'taxjar_download' => 'yes', 'store_zip' => '80111', 'store_city' => 'Greenwood Village', 'debug' => 'yes'));
     update_option('woocommerce_default_country', 'US:CO');
     update_option('woocommerce_calc_shipping', 'yes');
     $wc_install = new WC_Install();
     $wc_install->install();
     do_action('plugins_loaded');
 }
Exemplo n.º 4
0
 /**
  * Test - install
  */
 public function test_install()
 {
     // clean existing install first
     if (!defined('WP_UNINSTALL_PLUGIN')) {
         define('WP_UNINSTALL_PLUGIN', true);
     }
     include dirname(dirname(dirname(dirname(__FILE__)))) . '/uninstall.php';
     \WC_Install::install();
     $this->assertTrue(get_option('woocommerce_version') === WC()->version);
 }
Exemplo n.º 5
0
 /**
  * Install WooCommerce after the test environment and WC have been loaded
  *
  * @since 2.2
  */
 public function install_wc()
 {
     // clean existing install first
     define('WP_UNINSTALL_PLUGIN', true);
     include $this->plugin_dir . '/uninstall.php';
     WC_Install::install();
     // reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
     $GLOBALS['wp_roles']->reinit();
     echo "Installing WooCommerce..." . PHP_EOL;
 }
Exemplo n.º 6
0
 /**
  * Install WooCommerce after the test environment and WC have been loaded
  *
  * @since 2.2
  */
 public function install_wc()
 {
     // clean existing install first
     define('WP_UNINSTALL_PLUGIN', true);
     include $this->plugin_dir . '/uninstall.php';
     WC_Install::install();
     update_option('woocommerce_calc_shipping', 'yes');
     // Needed for tests cart and shipping methods
     // reload capabilities after install, see https://core.trac.wordpress.org/ticket/28374
     $GLOBALS['wp_roles']->reinit();
     echo "Installing WooCommerce..." . PHP_EOL;
 }