Skip to content

Commit 1f0085f

Browse files
Compatibility updates for WC >= 6.5.0 (#2348)
* Add WP 6.0 to compat workflow * Bump min PHP to 7.2 (min required ver by WooCommerce 6.5.0 beta) * Add WP 6.0-RC1 to compat workflow * Don't assert Note::$primary property for WC >= 6.5.0 Fixes #2347 The "primary" property was removed from `Automattic\WooCommerce\Admin\Notes\Note` in WC 6.5.0. This change skips the assertion for the primary property in WC >=6.5.0 See https://github.com/woocommerce/woocommerce-admin/pull/8474/files#r829672400 * Update L-2 WC testing versions, remove WP RC from compat workflow * Workaround for running tests with WC 6.4.1 Also excludes WC 6.5.0 from being tested with PHP 7.0. * Updated 'WC tested up to' version to 6.5 Co-authored-by: Diego Curbelo <[email protected]>
1 parent 137b14f commit 1f0085f

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

.github/workflows/compatibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
woocommerce: [ 'beta' ]
1313
wordpress: [ 'latest' ]
14-
php: [ '7.0', '7.4', '8.0' ]
14+
php: [ '7.2', '7.4', '8.0' ]
1515

1616

1717
name: Beta (PHP=${{ matrix.php }}, WP=${{ matrix.wordpress }}, WC=${{ matrix.woocommerce }})

.github/workflows/php-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
include:
1717
# WooCommerce
1818
- woocommerce_support_policy: L
19-
woocommerce: '6.2.0'
19+
woocommerce: '6.5.0'
2020
- woocommerce_support_policy: L-1
21-
woocommerce: '6.1.0'
21+
woocommerce: '6.4.1'
2222
- woocommerce_support_policy: L-2
23-
woocommerce: '6.0.0'
23+
woocommerce: '6.3.1'
2424
# WordPress
2525
- wordpress_support_policy: L
2626
wordpress: '5.9'
@@ -35,6 +35,9 @@ jobs:
3535
php: '7.4'
3636
- php_support_policy: L-2
3737
php: '7.0'
38+
exclude:
39+
- woocommerce_support_policy: L
40+
php_support_policy: L-2
3841

3942
name: Stable (PHP=${{ matrix.php_support_policy }}, WP=${{ matrix.wordpress_support_policy }}, WC=${{ matrix.woocommerce_support_policy }})
4043
env:

tests/phpunit/setup.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
* Set up shared by all tests.
44
*/
55
update_option( 'woocommerce_default_country', 'US:CA' );
6+
7+
if ( version_compare( WC_VERSION, '6.4.1', '=' ) ) {
8+
\Automattic\WooCommerce\Internal\Admin\Install::create_tables();
9+
\Automattic\WooCommerce\Internal\Admin\Install::create_events();
10+
}

tests/phpunit/test-class-wc-stripe-upe-availability-note.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public function test_get_note() {
2424
$this->assertSame( 'wc-stripe-upe-availability-note', $enable_upe_action->name );
2525
$this->assertSame( 'Enable in your store', $enable_upe_action->label );
2626
$this->assertSame( '?page=wc-settings&tab=checkout&section=stripe&panel=settings&highlight=enable-upe', $enable_upe_action->query );
27-
$this->assertSame( true, $enable_upe_action->primary );
27+
if ( version_compare( WC_VERSION, '6.5.0', '<' ) ) {
28+
$this->assertSame( true, $enable_upe_action->primary );
29+
}
2830
} else {
2931
$this->markTestSkipped( 'The used WC components are not backward compatible' );
3032
}

woocommerce-gateway-stripe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Requires at least: 5.6
1010
* Tested up to: 5.9
1111
* WC requires at least: 5.7
12-
* WC tested up to: 6.2
12+
* WC tested up to: 6.5
1313
* Text Domain: woocommerce-gateway-stripe
1414
* Domain Path: /languages
1515
*/

0 commit comments

Comments
 (0)