Skip to content

Commit 5d12672

Browse files
committed
Fix Admin Notices faling tests (#4059)
* Add legacy_deprecation to the expected notices list if legacy checkout is enabled * Hide legacy_deprecation notice when checking for valid key notices * Update WC L, L-1 and L-2 versions for php tests * Remove WP 6.5 from the support matrix
1 parent 7770d7a commit 5d12672

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.github/workflows/php-tests.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ jobs:
1616
include:
1717
# WooCommerce
1818
- woocommerce_support_policy: L
19-
woocommerce: '9.5.2'
19+
woocommerce: '9.7.1'
2020
- woocommerce_support_policy: L-1
21-
woocommerce: '9.3.4'
21+
woocommerce: '9.6.2'
2222
- woocommerce_support_policy: L-2
23-
woocommerce: '9.2.3'
23+
woocommerce: '9.5.2'
2424
# WordPress
2525
- wordpress_support_policy: L
26-
wordpress: '6.7'
26+
wordpress: '6.7.2'
2727
- wordpress_support_policy: L-1
28-
wordpress: '6.6'
28+
wordpress: '6.6.2'
29+
# WooCommerce 9.5.0+ requires WordPress 6.6+
30+
# (we'll keep two versions from the 6.6 branch until Apr when WP 6.8 is released)
2931
- wordpress_support_policy: L-2
30-
wordpress: '6.5'
32+
wordpress: '6.6'
3133
# PHP
3234
- php_support_policy: L
3335
php: '8.1'

tests/phpunit/admin/test-wc-stripe-admin-notices.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ public function test_correct_stripe_notices_are_shown_in_all_scenarios( $options
5555
$notices = new WC_Stripe_Admin_Notices();
5656
ob_start();
5757
$notices->admin_notices();
58-
if ( WC_Stripe_Helper::is_wc_lt( WC_STRIPE_FUTURE_MIN_WC_VER ) ) {
59-
// Displaying the style notice results in an early return.
60-
if ( ! in_array( 'style', $expected_notices, true ) ) {
58+
// Displaying the style notice results in an early return.
59+
if ( ! in_array( 'style', $expected_notices, true ) ) {
60+
if ( WC_Stripe_Helper::is_wc_lt( WC_STRIPE_FUTURE_MIN_WC_VER ) ) {
6161
// This means a version support notice will be added.
6262
$expected_notices[] = 'wcver';
6363
}
64+
if ( ! WC_Stripe_Feature_Flags::is_upe_checkout_enabled() ) {
65+
// This means the legacy checkout support notice will be added.
66+
$expected_notices[] = 'legacy_deprecation';
67+
}
6468
}
6569

6670
if ( $expected_output ) {
@@ -143,6 +147,7 @@ public function test_invalid_keys_notice_is_shown_when_account_data_is_not_valid
143147
);
144148
update_option( 'wc_stripe_show_style_notice', 'no' );
145149
update_option( 'wc_stripe_show_sca_notice', 'no' );
150+
update_option( 'wc_stripe_show_legacy_deprecation_notice', 'no' );
146151
update_option( 'home', 'https://...' );
147152

148153
$notices = new WC_Stripe_Admin_Notices();

0 commit comments

Comments
 (0)