Skip to content
Snippets Groups Projects
Select Git revision
  • 6433889e10d745d5aad809c7121fc2684b2e56c8
  • master default protected
  • fix/woo-stubs-dir
  • default-packages
  • use-internal-packages
  • update-setup
  • feature/wpdesk-cs
  • 2.5.3
  • 2.5.2
  • 2.5.1
  • 2.5.0
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3
  • 2.2.1
  • 2.2
  • 2.1
  • 2.0
  • 1.10.15
  • 1.10.12
  • 1.10.8
  • 1.10.7
  • 1.10.6
  • 1.10.5
  • 1.10.3
  • 1.10.2
27 results

bootstrap.php

Blame
  • bootstrap.php 1.12 KiB
    <?php
    
    error_reporting( E_ALL & ~E_DEPRECATED );
    ini_set('display_errors', '1');
    ini_set('display_startup_errors', '1');
    
    // disable xdebug backtrace
    if ( function_exists( 'xdebug_disable' ) ) {
    	xdebug_disable();
    }
    
    if ( getenv( 'PLUGIN_PATH' ) !== false ) {
    	define( 'PLUGIN_PATH', getenv( 'PLUGIN_PATH' ) );
    } else {
    	define( 'PLUGIN_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR );
    }
    
    require_once( getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/functions.php' );
    
    tests_add_filter( 'muplugins_loaded', function () {
    	update_option( 'active_plugins', [] );
    }, 100 );
    
    putenv('WP_TESTS_DIR=' . getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit');
    require_once( getenv( 'WC_DEVELOP_DIR' ) . '/tests/legacy/bootstrap.php' );
    
    $plugins_to_active = get_option( 'active_plugins' );
    if (!is_array($plugins_to_active)) {
    	$plugins_to_active = [];
    }
    $plugins_to_active[] = 'woocommerce/woocommerce.php';
    update_option( 'active_plugins', $plugins_to_active );
    
    do_action('plugins_loaded');
    
    echo "\n\n";
    echo 'WC_VERSION=' . WC_VERSION . "\n";
    echo 'PHP_VERSION=' . phpversion() . "\n";
    echo "\n\n";