Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 6 additions & 78 deletions features/language-core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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=<original> --force`
And wp-config.php
And I run `wp core install --url='localhost:8001' --title='Test' --admin_user=wpcli [email protected] --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=<update> --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:
"""
<update>
"""
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
Expand Down Expand Up @@ -360,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
Expand All @@ -378,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=4.5.3 --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/4.5.3
Downloading translation from https://downloads.wordpress.org/translation/core/5.6.14
"""
And STDOUT should contain:
"""
Expand Down