From 3185a114f5aa97911b48fe521e07a3d61151c0a0 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 30 Oct 2026 22:14:49 +0100 Subject: [PATCH] Test wp-cli/wp-cli-tests#404 Co-Authored-By: Claude Opus 5.5 --- composer.json | 2 +- features/language-core.feature | 10 ++++- features/language-plugin.feature | 73 +++++++++++++++++++++++--------- features/language-theme.feature | 58 +++++++++++++++++++------ 4 files changed, 106 insertions(+), 37 deletions(-) diff --git a/composer.json b/composer.json index f309062a..0d930ecc 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "wp-cli/db-command": "^1.3 || ^2 || ^3", "wp-cli/entity-command": "^1.3 || ^2 || ^3", "wp-cli/extension-command": "^1.2 || ^2 || ^3", - "wp-cli/wp-cli-tests": "^5" + "wp-cli/wp-cli-tests": "dev-cached-extension-installs as 5.3.99" }, "config": { "process-timeout": 7200, diff --git a/features/language-core.feature b/features/language-core.feature index b94541f3..4205eb72 100644 --- a/features/language-core.feature +++ b/features/language-core.feature @@ -343,7 +343,10 @@ Feature: Manage core translation files for a WordPress install @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 these installed themes: + """ + twentytwentyone + """ And I run `wp theme activate twentytwentyone` And an empty cache And I run `wp core download --version=5.6.14 --force` @@ -364,7 +367,10 @@ Feature: Manage core translation files for a WordPress install @require-wp-4.0 @require-mysql Scenario: Ensure upgrader output is in English Given a WP install - And I try `wp theme install twentytwentyone` + And these installed themes: + """ + twentytwentyone + """ And I run `wp theme activate twentytwentyone` And an empty cache And I run `wp core download --version=5.4.1 --force` diff --git a/features/language-plugin.feature b/features/language-plugin.feature index b738af15..a745eb6e 100644 --- a/features/language-plugin.feature +++ b/features/language-plugin.feature @@ -272,8 +272,11 @@ Feature: Manage plugin translation files for a WordPress install Scenario: Ensure correct language is installed for plugin version Given a WP install And an empty cache - And I run `wp plugin install akismet --version=3.2 --force` - And I run `wp plugin install jetpack --version=6.0 --force` + And these installed plugins: + """ + akismet --version=3.2 --force + jetpack --version=6.0 --force + """ When I run `wp language plugin install akismet de_DE_formal` Then STDOUT should contain: @@ -309,9 +312,12 @@ Feature: Manage plugin translation files for a WordPress install | akismet | de_DE_formal | none | installed | | jetpack | de_DE | none | installed | - When I run `wp plugin install akismet --version=4.0 --force` - And I run `wp plugin install jetpack --version=6.4 --force` - And I run `wp language plugin list --all --fields=plugin,language,update,status` + Given these installed plugins: + """ + akismet --version=4.0 --force + jetpack --version=6.4 --force + """ + When I run `wp language plugin list --all --fields=plugin,language,update,status` Then STDOUT should be a table containing rows: | plugin | language | update | status | | akismet | de_DE_formal | available | installed | @@ -351,8 +357,11 @@ Feature: Manage plugin translation files for a WordPress install Scenario: Ensure availability status is correct for each plugin Given a WP install And an empty cache - And I run `wp plugin install akismet --version=3.2 --force` - And I run `wp plugin install jetpack --version=6.0 --force` + And these installed plugins: + """ + akismet --version=3.2 --force + jetpack --version=6.0 --force + """ When I run `wp language plugin install akismet de_DE` Then STDOUT should contain: @@ -367,9 +376,12 @@ Feature: Manage plugin translation files for a WordPress install """ And STDERR should be empty - When I run `wp plugin install akismet --version=4.0 --force` - And I run `wp plugin install jetpack --version=6.4 --force` - And I run `wp language plugin update jetpack` + Given these installed plugins: + """ + akismet --version=4.0 --force + jetpack --version=6.4 --force + """ + When I run `wp language plugin update jetpack` Then STDOUT should contain: """ Downloading translation from https://downloads.wordpress.org/translation/plugin/jetpack/6.4/de_DE.zip @@ -388,8 +400,11 @@ Feature: Manage plugin translation files for a WordPress install And I run `wp plugin path` And save STDOUT as {PLUGIN_DIR} And an empty {PLUGIN_DIR} directory - And I run `wp plugin install akismet --version=4.0 --force` - And I run `wp plugin install jetpack --version=6.4 --force` + And these installed plugins: + """ + akismet --version=4.0 --force + jetpack --version=6.4 --force + """ When I try `wp language plugin install de_DE` Then the return code should be 1 @@ -478,8 +493,11 @@ Feature: Manage plugin translation files for a WordPress install When I run `wp language plugin install akismet de_DE` Then STDERR should be empty - When I run `wp plugin install akismet --version=4.0 --force` - And I run `wp language plugin list akismet --fields=plugin,language,update,status` + Given these installed plugins: + """ + akismet --version=4.0 --force + """ + When I run `wp language plugin list akismet --fields=plugin,language,update,status` Then STDOUT should be a table containing rows: | plugin | language | update | status | | akismet | de_DE | available | installed | @@ -492,9 +510,15 @@ Feature: Manage plugin translation files for a WordPress install And STDERR should be empty When I run `wp language plugin uninstall akismet de_DE` - And I run `wp plugin install akismet --version=3.2 --force` + And these installed plugins: + """ + akismet --version=3.2 --force + """ And I run `wp language plugin install akismet de_DE` - And I run `wp plugin install akismet --version=4.0 --force` + And these installed plugins: + """ + akismet --version=4.0 --force + """ And I run `wp language plugin update akismet --format=csv` Then STDOUT should contain: """ @@ -507,9 +531,15 @@ Feature: Manage plugin translation files for a WordPress install And STDERR should be empty When I run `wp language plugin uninstall akismet de_DE` - And I run `wp plugin install akismet --version=3.2 --force` + And these installed plugins: + """ + akismet --version=3.2 --force + """ And I run `wp language plugin install akismet de_DE` - And I run `wp plugin install akismet --version=4.0 --force` + And these installed plugins: + """ + akismet --version=4.0 --force + """ And I run `wp language plugin update akismet --format=summary` Then STDOUT should contain: """ @@ -528,8 +558,11 @@ Feature: Manage plugin translation files for a WordPress install When I run `wp language plugin install akismet de_DE` Then STDERR should be empty - When I run `wp plugin install akismet --version=4.0 --force` - And I run `wp language plugin list akismet --fields=plugin,language,update,status` + Given these installed plugins: + """ + akismet --version=4.0 --force + """ + When I run `wp language plugin list akismet --fields=plugin,language,update,status` Then STDOUT should be a table containing rows: | plugin | language | update | status | | akismet | de_DE | available | installed | diff --git a/features/language-theme.feature b/features/language-theme.feature index cb58ea17..11101383 100644 --- a/features/language-theme.feature +++ b/features/language-theme.feature @@ -230,7 +230,10 @@ Feature: Manage theme translation files for a WordPress install Scenario: Ensure correct language is installed for theme version Given a WP install And an empty cache - And I run `wp theme install twentyseventeen --version=1.0 --force` + And these installed themes: + """ + twentyseventeen --version=1.0 --force + """ When I run `wp language theme install twentyseventeen de_DE` Then STDOUT should contain: @@ -238,8 +241,11 @@ Feature: Manage theme translation files for a WordPress install Downloading translation from https://downloads.wordpress.org/translation/theme/twentyseventeen/1.0/de_DE.zip """ - When I run `wp theme install twentyseventeen --version=1.6 --force` - And I run `wp language theme update twentyseventeen` + Given these installed themes: + """ + twentyseventeen --version=1.6 --force + """ + When I run `wp language theme update twentyseventeen` Then STDOUT should contain: """ Downloading translation from https://downloads.wordpress.org/translation/theme/twentyseventeen/1.6/de_DE.zip @@ -251,8 +257,11 @@ Feature: Manage theme translation files for a WordPress install And I run `wp theme path` And save STDOUT as {THEME_DIR} And an empty {THEME_DIR} directory - And I run `wp theme install twentyseventeen --version=1.0 --force` - And I run `wp theme install twentysixteen --version=1.0 --force` + And these installed themes: + """ + twentyseventeen --version=1.0 --force + twentysixteen --version=1.0 --force + """ When I try `wp language theme install de_DE` Then the return code should be 1 @@ -316,7 +325,10 @@ Feature: Manage theme translation files for a WordPress install Scenario: List languages by multiple statuses Given a WP install And an empty cache - And I run `wp theme install twentyten --force` + And these installed themes: + """ + twentyten --force + """ And I run `wp language theme install twentyten nl_NL` When I run `wp language theme list twentyten --fields=language,status --status=active,installed` @@ -362,8 +374,11 @@ Feature: Manage theme translation files for a WordPress install When I run `wp language theme install twentyfifteen de_DE` Then STDERR should be empty - When I run `wp theme install twentyfifteen --version=2.5 --force` - And I run `wp language theme list twentyfifteen --fields=theme,language,update,status` + Given these installed themes: + """ + twentyfifteen --version=2.5 --force + """ + When I run `wp language theme list twentyfifteen --fields=theme,language,update,status` Then STDOUT should be a table containing rows: | theme | language | update | status | | twentyfifteen | de_DE | available | installed | @@ -376,9 +391,15 @@ Feature: Manage theme translation files for a WordPress install And STDERR should be empty When I run `wp language theme uninstall twentyfifteen de_DE` - And I run `wp theme install twentyfifteen --version=2.0 --force` + And these installed themes: + """ + twentyfifteen --version=2.0 --force + """ And I run `wp language theme install twentyfifteen de_DE` - And I run `wp theme install twentyfifteen --version=2.5 --force` + And these installed themes: + """ + twentyfifteen --version=2.5 --force + """ And I run `wp language theme update twentyfifteen --format=csv` Then STDOUT should contain: """ @@ -391,9 +412,15 @@ Feature: Manage theme translation files for a WordPress install And STDERR should be empty When I run `wp language theme uninstall twentyfifteen de_DE` - And I run `wp theme install twentyfifteen --version=2.0 --force` + And these installed themes: + """ + twentyfifteen --version=2.0 --force + """ And I run `wp language theme install twentyfifteen de_DE` - And I run `wp theme install twentyfifteen --version=2.5 --force` + And these installed themes: + """ + twentyfifteen --version=2.5 --force + """ And I run `wp language theme update twentyfifteen --format=summary` Then STDOUT should contain: """ @@ -412,8 +439,11 @@ Feature: Manage theme translation files for a WordPress install When I run `wp language theme install twentyfifteen de_DE` Then STDERR should be empty - When I run `wp theme install twentyfifteen --version=2.5 --force` - And I run `wp language theme list twentyfifteen --fields=theme,language,update,status` + Given these installed themes: + """ + twentyfifteen --version=2.5 --force + """ + When I run `wp language theme list twentyfifteen --fields=theme,language,update,status` Then STDOUT should be a table containing rows: | theme | language | update | status | | twentyfifteen | de_DE | available | installed |