@@ -6,32 +6,32 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Set up subscriptions mocks. |
9 | -function wcs_order_contains_subscription( $order ) { |
|
10 | - if ( ! WC_Subscriptions::$wcs_order_contains_subscription ) { |
|
9 | +function wcs_order_contains_subscription($order) { |
|
10 | + if ( ! WC_Subscriptions::$wcs_order_contains_subscription) { |
|
11 | 11 | return; |
12 | 12 | } |
13 | - return call_user_func( WC_Subscriptions::$wcs_order_contains_subscription, $order ); |
|
13 | + return call_user_func(WC_Subscriptions::$wcs_order_contains_subscription, $order); |
|
14 | 14 | } |
15 | 15 | |
16 | -function wcs_get_subscriptions_for_order( $order ) { |
|
17 | - if ( ! WC_Subscriptions::$wcs_get_subscriptions_for_order ) { |
|
16 | +function wcs_get_subscriptions_for_order($order) { |
|
17 | + if ( ! WC_Subscriptions::$wcs_get_subscriptions_for_order) { |
|
18 | 18 | return; |
19 | 19 | } |
20 | - return call_user_func( WC_Subscriptions::$wcs_get_subscriptions_for_order, $order ); |
|
20 | + return call_user_func(WC_Subscriptions::$wcs_get_subscriptions_for_order, $order); |
|
21 | 21 | } |
22 | 22 | |
23 | -function wcs_is_subscription( $order ) { |
|
24 | - if ( ! WC_Subscriptions::$wcs_is_subscription ) { |
|
23 | +function wcs_is_subscription($order) { |
|
24 | + if ( ! WC_Subscriptions::$wcs_is_subscription) { |
|
25 | 25 | return; |
26 | 26 | } |
27 | - return call_user_func( WC_Subscriptions::$wcs_is_subscription, $order ); |
|
27 | + return call_user_func(WC_Subscriptions::$wcs_is_subscription, $order); |
|
28 | 28 | } |
29 | 29 | |
30 | -function wcs_get_subscription( $subscription ) { |
|
31 | - if ( ! WC_Subscriptions::$wcs_get_subscription ) { |
|
30 | +function wcs_get_subscription($subscription) { |
|
31 | + if ( ! WC_Subscriptions::$wcs_get_subscription) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | - return call_user_func( WC_Subscriptions::$wcs_get_subscription, $subscription ); |
|
34 | + return call_user_func(WC_Subscriptions::$wcs_get_subscription, $subscription); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -75,19 +75,19 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public static $wcs_get_subscription = null; |
77 | 77 | |
78 | - public static function set_wcs_order_contains_subscription( $function ) { |
|
78 | + public static function set_wcs_order_contains_subscription($function) { |
|
79 | 79 | self::$wcs_order_contains_subscription = $function; |
80 | 80 | } |
81 | 81 | |
82 | - public static function set_wcs_get_subscriptions_for_order( $function ) { |
|
82 | + public static function set_wcs_get_subscriptions_for_order($function) { |
|
83 | 83 | self::$wcs_get_subscriptions_for_order = $function; |
84 | 84 | } |
85 | 85 | |
86 | - public static function set_wcs_is_subscription( $function ) { |
|
86 | + public static function set_wcs_is_subscription($function) { |
|
87 | 87 | self::$wcs_is_subscription = $function; |
88 | 88 | } |
89 | 89 | |
90 | - public static function set_wcs_get_subscription( $function ) { |
|
90 | + public static function set_wcs_get_subscription($function) { |
|
91 | 91 | self::$wcs_get_subscription = $function; |
92 | 92 | } |
93 | 93 | } |
@@ -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,25 +13,25 @@ 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_once ABSPATH . '/wp-content/plugins/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 | -require_once( __DIR__ . '/helpers/class-wc-helper-order.php' ); |
|
27 | -require_once( __DIR__ . '/helpers/class-wc-helper-product.php' ); |
|
28 | -require_once( __DIR__ . '/helpers/class-wc-helper-shipping.php' ); |
|
29 | -require_once( __DIR__ . '/helpers/class-wc-helper-token.php' ); |
|
30 | -require_once( __DIR__ . '/helpers/class-wc-helper-subscription.php' ); |
|
31 | -require_once( __DIR__ . '/helpers/class-wc-helper-subscriptions.php' ); |
|
32 | -require_once( __DIR__ . '/helpers/class-wc-helper-subscriptions-cart.php' ); |
|
26 | +require_once(__DIR__ . '/helpers/class-wc-helper-order.php'); |
|
27 | +require_once(__DIR__ . '/helpers/class-wc-helper-product.php'); |
|
28 | +require_once(__DIR__ . '/helpers/class-wc-helper-shipping.php'); |
|
29 | +require_once(__DIR__ . '/helpers/class-wc-helper-token.php'); |
|
30 | +require_once(__DIR__ . '/helpers/class-wc-helper-subscription.php'); |
|
31 | +require_once(__DIR__ . '/helpers/class-wc-helper-subscriptions.php'); |
|
32 | +require_once(__DIR__ . '/helpers/class-wc-helper-subscriptions-cart.php'); |
|
33 | 33 | |
34 | 34 | // We use outdated PHPUnit version, which emits deprecation errors in PHP 7.4 (deprecated reflection APIs). |
35 | -if ( defined( 'PHP_VERSION_ID' ) && PHP_VERSION_ID >= 70400 ) { |
|
36 | - error_reporting( error_reporting() ^ E_DEPRECATED ); // phpcs:ignore |
|
35 | +if (defined('PHP_VERSION_ID') && PHP_VERSION_ID >= 70400) { |
|
36 | + error_reporting(error_reporting() ^ E_DEPRECATED); // phpcs:ignore |
|
37 | 37 | } |