Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Add feature test for language core update for newer versions
  • Loading branch information
ernilambar committed Jun 3, 2024
commit bfc304009cac9b975bc942e4a896c5feb2ac07aa
71 changes: 71 additions & 0 deletions features/language-core.feature
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,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=<original> --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=<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 |
| 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
Expand Down