includes
3 years ago
mockfactory
1 month ago
tests
1 month ago
util
3 years ago
bootstrap.php
3 years ago
wp-tests-config.php
3 years ago
bootstrap.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | // path to test lib bootstrap.php |
| 4 | $test_lib_bootstrap_file = dirname( __FILE__ ) . '/includes/bootstrap.php'; |
| 5 | |
| 6 | if ( ! file_exists( $test_lib_bootstrap_file ) ) { |
| 7 | echo PHP_EOL . "Error : unable to find " . $test_lib_bootstrap_file . PHP_EOL; |
| 8 | exit( '' . PHP_EOL ); |
| 9 | } |
| 10 | |
| 11 | // set plugin and options for activation |
| 12 | $GLOBALS[ 'wp_tests_options' ] = array( |
| 13 | 'active_plugins' => array( |
| 14 | 'woocommerce/woocommerce.php', |
| 15 | basename(realpath(dirname(__FILE__) . '/../../')) . '/woo-razorpay.php' |
| 16 | ), |
| 17 | 'wpsp_test' => true |
| 18 | ); |
| 19 | |
| 20 | // call test-lib's bootstrap.php |
| 21 | require_once $test_lib_bootstrap_file; |
| 22 | |
| 23 | require_once 'tests/phpunit/util/class-util.php'; |
| 24 | require_once PLUGIN_DIR . '/vendor/autoload.php'; |
| 25 | $current_user = new WP_User( 1 ); |
| 26 | $current_user->set_role( 'administrator' ); |
| 27 | |
| 28 | echo PHP_EOL; |
| 29 | echo 'Using Wordpress core : ' . ABSPATH . PHP_EOL; |
| 30 | echo PHP_EOL; |
| 31 |