From ea6caffdad5c5685159883565e663685e783bfa0 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 8 Jul 2025 16:28:33 +0200 Subject: [PATCH 1/4] Remove now dead test We only test on PHP 7.2+ now --- features/language-core.feature | 72 ---------------------------------- 1 file changed, 72 deletions(-) diff --git a/features/language-core.feature b/features/language-core.feature index 3c92202a..8911301f 100644 --- a/features/language-core.feature +++ b/features/language-core.feature @@ -220,78 +220,6 @@ Feature: Manage core translation files for a WordPress install """ And the return code should be 0 - # This test downgrades to older WP version. PHP restriction is added to avoid warnings in latest versions. - @less-than-php-7.0 - Scenario Outline: Core translation update - Given an empty directory - And WP files - And a database - And I run `wp core download --version= --force` - And wp-config.php - And I run `wp core install --url='localhost:8001' --title='Test' --admin_user=wpcli --admin_email=admin@example.com --admin_password=1` - - When I run `wp language core list --fields=language,status,update` - Then STDOUT should be a table containing rows: - | language | status | update | - | ar | uninstalled | none | - | en_CA | uninstalled | none | - | en_US | active | none | - | ja | uninstalled | none | - - When I run `wp language core install en_CA ja` - Then the wp-content/languages/admin-en_CA.po file should exist - And the wp-content/languages/en_CA.po file should exist - And the wp-content/languages/admin-ja.po file should exist - And the wp-content/languages/ja.po file should exist - And STDOUT should contain: - """ - Success: Installed 2 of 2 languages. - """ - And STDERR should be empty - - Given I try `wp core download --version= --force` - Then the return code should be 0 - And I run `wp core update-db` - - When I run `wp language core list --fields=language,status,update` - Then STDOUT should be a table containing rows: - | language | status | update | - | ar | uninstalled | none | - | en_CA | installed | available | - | en_US | active | none | - | ja | installed | available | - - When I run `wp language core update --dry-run` - Then STDOUT should contain: - """ - Found 2 translation updates that would be processed - """ - And STDOUT should contain: - """ - Core - """ - And STDOUT should contain: - """ - WordPress - """ - And STDOUT should contain: - """ - - """ - And STDOUT should contain: - """ - English (Canada) - """ - And STDOUT should contain: - """ - Japanese - """ - - Examples: - | original | update | - | 4.8 | 4.9 | - | 4.0.1 | 4.2 | - @require-wp-6.0 @require-php-7.2 Scenario Outline: Core translation update in newer versions Given an empty directory From 86871ee597f4bd9a2b56009b86a579cb9ae73e34 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 8 Jul 2025 16:29:16 +0200 Subject: [PATCH 2/4] Don't downgrade to WP version too old Avoids warnings because of `get_magic_quotes_gpc` error in WP < 5.3 --- features/language-core.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/language-core.feature b/features/language-core.feature index 8911301f..6d2d46e3 100644 --- a/features/language-core.feature +++ b/features/language-core.feature @@ -313,13 +313,13 @@ Feature: Manage core translation files for a WordPress install And I try `wp theme install twentytwentyone` And I run `wp theme activate twentytwentyone` And an empty cache - And I run `wp core download --version=4.5.3 --force` + And I run `wp core download --version=5.4.1 --force` # PHP 8.2+ will show a warning for old WordPress core version. When I try `wp language core install nl_NL` Then STDOUT should contain: """ - Downloading translation from https://downloads.wordpress.org/translation/core/4.5.3 + Downloading translation from https://downloads.wordpress.org/translation/core/5.4.1 """ And STDOUT should contain: """ From 24c7b34f481e037ad8c0bb9796b1da2fc135788c Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 8 Jul 2025 17:39:07 +0200 Subject: [PATCH 3/4] Actually use 5.6.14 instead Fixes issue because of https://core.trac.wordpress.org/changeset/48839 --- features/language-core.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features/language-core.feature b/features/language-core.feature index 6d2d46e3..f4b40ca1 100644 --- a/features/language-core.feature +++ b/features/language-core.feature @@ -306,20 +306,20 @@ Feature: Manage core translation files for a WordPress install And STDOUT should be empty And the return code should be 0 - # This test downgrades to WordPress 5.4.1, but the SQLite plugin requires 6.0+ - @require-wp-4.0 @require-mysql + # This test downgrades to WordPress 5.6.14, but the SQLite plugin requires 6.0+ + @require-wp-5.7 @require-mysql Scenario: Ensure correct language is installed for WP version Given a WP install And I try `wp theme install twentytwentyone` And I run `wp theme activate twentytwentyone` And an empty cache - And I run `wp core download --version=5.4.1 --force` + And I run `wp core download --version=5.6.14 --force` # PHP 8.2+ will show a warning for old WordPress core version. When I try `wp language core install nl_NL` Then STDOUT should contain: """ - Downloading translation from https://downloads.wordpress.org/translation/core/5.4.1 + Downloading translation from https://downloads.wordpress.org/translation/core/5.6.14 """ And STDOUT should contain: """ From 7d907d1dde2c60946a813b11af7a1848930b40e0 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 8 Jul 2025 17:52:34 +0200 Subject: [PATCH 4/4] Update another test --- features/language-core.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/language-core.feature b/features/language-core.feature index f4b40ca1..4fe8e115 100644 --- a/features/language-core.feature +++ b/features/language-core.feature @@ -288,8 +288,8 @@ Feature: Manage core translation files for a WordPress install Examples: | original | update | - | 6.0 | 6.1 | - | 6.1.1 | 6.2 | + | 6.5 | 6.6 | + | 6.6.1 | 6.7 | @require-wp-4.0 Scenario: Don't allow active language to be uninstalled