1- Feature : Manage translation files for a WordPress install
1+ Feature : Manage core translation files for a WordPress install
22
33 @require-wp-4.0
44 Scenario : Core translation CRUD
@@ -178,14 +178,14 @@ Feature: Manage translation files for a WordPress install
178178 """
179179
180180 When I run `wp language core uninstall en_CA ja`
181- Then the wp-content/languages/admin-en_CA.po file should not exist
182- And the wp-content/languages/en_CA.po file should not exist
183- And the wp-content/languages/en_CA.l10n.php file should not exist
184- And the wp-content/languages/admin-ja.po file should not exist
185- And the wp-content/languages/ja.po file should not exist
186- And the wp-content/languages/ja.l10n.php file should not exist
187- And STDOUT should be:
188- """
181+ Then the wp-content/languages/admin-en_CA.po file should not exist
182+ And the wp-content/languages/en_CA.po file should not exist
183+ And the wp-content/languages/en_CA.l10n.php file should not exist
184+ And the wp-content/languages/admin-ja.po file should not exist
185+ And the wp-content/languages/ja.po file should not exist
186+ And the wp-content/languages/ja.l10n.php file should not exist
187+ And STDOUT should be:
188+ """
189189 Success: Language uninstalled.
190190 Success: Language uninstalled.
191191 """
@@ -220,78 +220,6 @@ Feature: Manage translation files for a WordPress install
220220 """
221221 And the return code should be 0
222222
223- # This test downgrades to older WP version. PHP restriction is added to avoid warnings in latest versions.
224- @less-than-php-7.0
225- Scenario Outline : Core translation update
226- Given an empty directory
227- And WP files
228- And a database
229- And I run `wp core download --version=<original> --force`
230- And wp-config.php
231- And I run `wp core install --url='localhost:8001' --title='Test' --admin_user=wpcli --admin_email=admin@example.com --admin_password=1`
232-
233- When I run `wp language core list --fields=language,status,update`
234- Then STDOUT should be a table containing rows:
235- | language | status | update |
236- | ar | uninstalled | none |
237- | en_CA | uninstalled | none |
238- | en_US | active | none |
239- | ja | uninstalled | none |
240-
241- When I run `wp language core install en_CA ja`
242- Then the wp-content/languages/admin-en_CA.po file should exist
243- And the wp-content/languages/en_CA.po file should exist
244- And the wp-content/languages/admin-ja.po file should exist
245- And the wp-content/languages/ja.po file should exist
246- And STDOUT should contain:
247- """
248- Success: Installed 2 of 2 languages.
249- """
250- And STDERR should be empty
251-
252- Given I try `wp core download --version=<update> --force`
253- Then the return code should be 0
254- And I run `wp core update-db`
255-
256- When I run `wp language core list --fields=language,status,update`
257- Then STDOUT should be a table containing rows:
258- | language | status | update |
259- | ar | uninstalled | none |
260- | en_CA | installed | available |
261- | en_US | active | none |
262- | ja | installed | available |
263-
264- When I run `wp language core update --dry-run`
265- Then STDOUT should contain:
266- """
267- Found 2 translation updates that would be processed
268- """
269- And STDOUT should contain:
270- """
271- Core
272- """
273- And STDOUT should contain:
274- """
275- WordPress
276- """
277- And STDOUT should contain:
278- """
279- <update>
280- """
281- And STDOUT should contain:
282- """
283- English (Canada)
284- """
285- And STDOUT should contain:
286- """
287- Japanese
288- """
289-
290- Examples :
291- | original | update |
292- | 4 .8 | 4 .9 |
293- | 4 .0 .1 | 4 .2 |
294-
295223 @require-wp-6.0 @require-php-7.2
296224 Scenario Outline : Core translation update in newer versions
297225 Given an empty directory
@@ -360,8 +288,8 @@ Feature: Manage translation files for a WordPress install
360288
361289 Examples :
362290 | original | update |
363- | 6 .0 | 6 .1 |
364- | 6 .1 .1 | 6 .2 |
291+ | 6 .5 | 6 .6 |
292+ | 6 .6 .1 | 6 .7 |
365293
366294 @require-wp-4.0
367295 Scenario : Don't allow active language to be uninstalled
@@ -378,20 +306,20 @@ Feature: Manage translation files for a WordPress install
378306 And STDOUT should be empty
379307 And the return code should be 0
380308
381- # This test downgrades to WordPress 5.4.1 , but the SQLite plugin requires 6.0+
382- @require-wp-4.0 @require-mysql
309+ # This test downgrades to WordPress 5.6.14 , but the SQLite plugin requires 6.0+
310+ @require-wp-5.7 @require-mysql
383311 Scenario : Ensure correct language is installed for WP version
384312 Given a WP install
385313 And I try `wp theme install twentytwentyone`
386314 And I run `wp theme activate twentytwentyone`
387315 And an empty cache
388- And I run `wp core download --version=4.5.3 --force`
316+ And I run `wp core download --version=5.6.14 --force`
389317
390318 # PHP 8.2+ will show a warning for old WordPress core version.
391319 When I try `wp language core install nl_NL`
392320 Then STDOUT should contain:
393321 """
394- Downloading translation from https://downloads.wordpress.org/translation/core/4.5.3
322+ Downloading translation from https://downloads.wordpress.org/translation/core/5.6.14
395323 """
396324 And STDOUT should contain:
397325 """
@@ -439,52 +367,52 @@ Feature: Manage translation files for a WordPress install
439367 Die aktuelle Version wird installiert
440368 """
441369
442- @require-wp-4.0
443- Scenario : Show correct active language after switching
444- Given a WP install
445- And an empty cache
370+ @require-wp-4.0
371+ Scenario : Show correct active language after switching
372+ Given a WP install
373+ And an empty cache
446374
447- When I try `wp language core is-installed en_US`
448- Then the return code should be 0
375+ When I try `wp language core is-installed en_US`
376+ Then the return code should be 0
449377
450- When I run `wp language core install de_DE`
451- Then the wp-content/languages/admin-de_DE.po file should exist
452- And the wp-content/languages/de_DE.po file should exist
453- And STDOUT should contain:
378+ When I run `wp language core install de_DE`
379+ Then the wp-content/languages/admin-de_DE.po file should exist
380+ And the wp-content/languages/de_DE.po file should exist
381+ And STDOUT should contain:
454382 """
455383 Success: Installed 1 of 1 languages.
456384 """
457- And STDERR should be empty
385+ And STDERR should be empty
458386
459- When I try `wp language core is-installed de_DE`
460- Then the return code should be 0
387+ When I try `wp language core is-installed de_DE`
388+ Then the return code should be 0
461389
462- When I run `wp language core list --field=language --status=active`
463- Then STDOUT should be:
390+ When I run `wp language core list --field=language --status=active`
391+ Then STDOUT should be:
464392 """
465393 en_US
466394 """
467395
468- When I run `wp site switch-language de_DE`
469- Then STDOUT should be:
396+ When I run `wp site switch-language de_DE`
397+ Then STDOUT should be:
470398 """
471399 Success: Language activated.
472400 """
473401
474- When I run `wp language core list --field=language --status=active`
475- Then STDOUT should be:
402+ When I run `wp language core list --field=language --status=active`
403+ Then STDOUT should be:
476404 """
477405 de_DE
478406 """
479407
480- When I run `wp site switch-language en_US`
481- Then STDOUT should be:
408+ When I run `wp site switch-language en_US`
409+ Then STDOUT should be:
482410 """
483411 Success: Language activated.
484412 """
485413
486- When I run `wp language core list --field=language --status=active`
487- Then STDOUT should be:
414+ When I run `wp language core list --field=language --status=active`
415+ Then STDOUT should be:
488416 """
489417 en_US
490418 """
@@ -535,3 +463,16 @@ Feature: Manage translation files for a WordPress install
535463 """
536464 en_US
537465 """
466+
467+ @require-wp-4.0
468+ Scenario : List languages by multiple statuses
469+ Given a WP install
470+ And an empty cache
471+ And I run `wp language core install nl_NL`
472+
473+ When I run `wp language core list --fields=language,status --status=active,installed`
474+ Then STDOUT should be a table containing rows:
475+ | language | status |
476+ | en_US | active |
477+ | nl_NL | installed |
478+ And STDERR should be empty
0 commit comments