Skip to content

Commit 7bf7b06

Browse files
authored
Merge pull request #149 from ernilambar/148-update-tests
2 parents 2e6edc6 + 13df25e commit 7bf7b06

1 file changed

Lines changed: 73 additions & 1 deletion

File tree

‎features/language-core.feature‎

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ Feature: Manage translation files for a WordPress install
214214
"""
215215
And the return code should be 0
216216

217-
@require-php-5.6 @less-than-php-7.0
217+
# This test downgrades to older WP version. PHP restriction is added to avoid warnings in latest versions.
218+
@less-than-php-7.0
218219
Scenario Outline: Core translation update
219220
Given an empty directory
220221
And WP files
@@ -285,6 +286,77 @@ Feature: Manage translation files for a WordPress install
285286
| 4.8 | 4.9 |
286287
| 4.0.1 | 4.2 |
287288

289+
@require-wp-6.0 @require-php-7.2
290+
Scenario Outline: Core translation update in newer versions
291+
Given an empty directory
292+
And WP files
293+
And a database
294+
And I run `wp core download --version=<original> --force`
295+
And wp-config.php
296+
And I run `wp core install --url='localhost:8001' --title='Test' --admin_user=wpcli --admin_email=admin@example.com --admin_password=1`
297+
298+
When I run `wp language core list --fields=language,status,update`
299+
Then STDOUT should be a table containing rows:
300+
| language | status | update |
301+
| ar | uninstalled | none |
302+
| en_CA | uninstalled | none |
303+
| en_US | active | none |
304+
| ja | uninstalled | none |
305+
306+
When I run `wp language core install en_CA ja`
307+
Then the wp-content/languages/admin-en_CA.po file should exist
308+
And the wp-content/languages/en_CA.po file should exist
309+
And the wp-content/languages/admin-ja.po file should exist
310+
And the wp-content/languages/ja.po file should exist
311+
And STDOUT should contain:
312+
"""
313+
Success: Installed 2 of 2 languages.
314+
"""
315+
And STDERR should be empty
316+
317+
Given I try `wp core download --version=<update> --force`
318+
Then the return code should be 0
319+
And I run `wp core update-db`
320+
321+
When I run `wp language core list --fields=language,status,update`
322+
Then STDOUT should be a table containing rows:
323+
| language | status | update |
324+
| ar | uninstalled | none |
325+
| en_CA | installed | available |
326+
| en_US | active | none |
327+
| ja | installed | available |
328+
329+
When I run `wp language core update --dry-run`
330+
Then STDOUT should contain:
331+
"""
332+
Found 2 translation updates that would be processed
333+
"""
334+
And STDOUT should contain:
335+
"""
336+
Core
337+
"""
338+
And STDOUT should contain:
339+
"""
340+
WordPress
341+
"""
342+
And STDOUT should contain:
343+
"""
344+
<update>
345+
"""
346+
And STDOUT should contain:
347+
"""
348+
English (Canada)
349+
"""
350+
And STDOUT should contain:
351+
"""
352+
Japanese
353+
"""
354+
355+
Examples:
356+
| original | update |
357+
| 6.0 | 6.1 |
358+
| 6.1.1 | 6.2 |
359+
288360
@require-wp-4.0
289361
Scenario: Don't allow active language to be uninstalled
290362
Given a WP install

0 commit comments

Comments
 (0)