diff --git a/features/language-core.feature b/features/language-core.feature index f4bcf251..39b441c2 100644 --- a/features/language-core.feature +++ b/features/language-core.feature @@ -214,7 +214,8 @@ Feature: Manage translation files for a WordPress install """ And the return code should be 0 - @require-php-5.6 @less-than-php-7.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 @@ -285,6 +286,77 @@ Feature: Manage translation files for a WordPress install | 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 + 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 | + | 6.0 | 6.1 | + | 6.1.1 | 6.2 | + @require-wp-4.0 Scenario: Don't allow active language to be uninstalled Given a WP install