@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | 'cost' => '10', |
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | - update_option( 'woocommerce_flat_rate_settings', $flat_rate_settings ); |
|
| 31 | - update_option( 'woocommerce_flat_rate', [] ); |
|
| 32 | - WC_Cache_Helper::get_transient_version( 'shipping', true ); |
|
| 30 | + update_option('woocommerce_flat_rate_settings', $flat_rate_settings); |
|
| 31 | + update_option('woocommerce_flat_rate', []); |
|
| 32 | + WC_Cache_Helper::get_transient_version('shipping', true); |
|
| 33 | 33 | WC()->shipping()->load_shipping_methods(); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | * @since 2.3 |
| 40 | 40 | */ |
| 41 | 41 | public static function delete_simple_flat_rate() { |
| 42 | - delete_option( 'woocommerce_flat_rate_settings' ); |
|
| 43 | - delete_option( 'woocommerce_flat_rate' ); |
|
| 44 | - WC_Cache_Helper::get_transient_version( 'shipping', true ); |
|
| 42 | + delete_option('woocommerce_flat_rate_settings'); |
|
| 43 | + delete_option('woocommerce_flat_rate'); |
|
| 44 | + WC_Cache_Helper::get_transient_version('shipping', true); |
|
| 45 | 45 | WC()->shipping()->unregister_shipping_methods(); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$_tests_dir = getenv( 'WP_TESTS_DIR' ) ?: '/tmp/wordpress-tests-lib'; |
|
| 3 | +$_tests_dir = getenv('WP_TESTS_DIR') ?: '/tmp/wordpress-tests-lib'; |
|
| 4 | 4 | |
| 5 | -if ( PHP_VERSION_ID >= 80000 && is_dir( $_tests_dir . '/includes/phpunit7/MockObject' ) ) { |
|
| 5 | +if (PHP_VERSION_ID >= 80000 && is_dir($_tests_dir . '/includes/phpunit7/MockObject')) { |
|
| 6 | 6 | // WP Core test library includes patches for PHPUnit 7 to make it compatible with PHP8. |
| 7 | 7 | require_once $_tests_dir . '/includes/phpunit7/MockObject/Builder/NamespaceMatch.php'; |
| 8 | 8 | require_once $_tests_dir . '/includes/phpunit7/MockObject/Builder/ParametersMatch.php'; |
@@ -13,17 +13,17 @@ discard block |
||
| 13 | 13 | require_once $_tests_dir . '/includes/functions.php'; |
| 14 | 14 | |
| 15 | 15 | function _manually_load_plugin() { |
| 16 | - $plugins_dir = dirname( dirname( dirname( __DIR__ ) ) ); |
|
| 16 | + $plugins_dir = dirname(dirname(dirname(__DIR__))); |
|
| 17 | 17 | require $plugins_dir . '/woocommerce/woocommerce.php'; |
| 18 | 18 | require __DIR__ . '/setup.php'; |
| 19 | 19 | require $plugins_dir . '/woocommerce-gateway-stripe/woocommerce-gateway-stripe.php'; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' ); |
|
| 22 | +tests_add_filter('muplugins_loaded', '_manually_load_plugin'); |
|
| 23 | 23 | |
| 24 | 24 | require $_tests_dir . '/includes/bootstrap.php'; |
| 25 | 25 | |
| 26 | 26 | // We use outdated PHPUnit version, which emits deprecation errors in PHP 7.4 (deprecated reflection APIs). |
| 27 | -if ( defined( 'PHP_VERSION_ID' ) && PHP_VERSION_ID >= 70400 ) { |
|
| 28 | - error_reporting( error_reporting() ^ E_DEPRECATED ); // phpcs:ignore |
|
| 27 | +if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 70400) { |
|
| 28 | + error_reporting(error_reporting() ^ E_DEPRECATED); // phpcs:ignore |
|
| 29 | 29 | } |