@@ -327,6 +327,119 @@ Feature: Manage theme translation files for a WordPress install
327327 And STDERR should be empty
328328
329329 @require-wp-4.0
330+ Scenario : Theme translation update with format flag
331+ Given a WP install
332+
333+ When I try `wp theme install twentyten`
334+ Then STDOUT should not be empty
335+
336+ When I run `wp language theme update twentyten --format=json`
337+ Then STDOUT should be:
338+ """
339+ []
340+ """
341+ And STDERR should be empty
342+
343+ When I run `wp language theme update --all --format=csv`
344+ Then STDOUT should be empty
345+ And STDERR should be empty
346+
347+ When I run `wp language theme update --all --format=summary`
348+ Then STDOUT should contain:
349+ """
350+ Success: Translations are up to date.
351+ """
352+ And STDERR should be empty
353+
354+ @require-wp-4.0
355+ Scenario : Theme translation update with format flag and actual updates
356+ Given a WP install
357+ And an empty cache
358+
359+ When I run `wp theme install twentyfifteen --version=2.0 --force`
360+ Then STDERR should be empty
361+
362+ When I run `wp language theme install twentyfifteen de_DE`
363+ Then STDERR should be empty
364+
365+ When I run `wp theme install twentyfifteen --version=2.5 --force`
366+ And I run `wp language theme list twentyfifteen --fields=theme,language,update,status`
367+ Then STDOUT should be a table containing rows:
368+ | theme | language | update | status |
369+ | twentyfifteen | de_DE | available | installed |
370+
371+ When I run `wp language theme update twentyfifteen --format=json`
372+ Then STDOUT should be JSON containing:
373+ """
374+ [{"slug":"twentyfifteen","language":"de_DE","status":"updated"}]
375+ """
376+ And STDERR should be empty
377+
378+ When I run `wp language theme uninstall twentyfifteen de_DE`
379+ And I run `wp theme install twentyfifteen --version=2.0 --force`
380+ And I run `wp language theme install twentyfifteen de_DE`
381+ And I run `wp theme install twentyfifteen --version=2.5 --force`
382+ And I run `wp language theme update twentyfifteen --format=csv`
383+ Then STDOUT should contain:
384+ """
385+ slug,language,status
386+ """
387+ And STDOUT should contain:
388+ """
389+ twentyfifteen,de_DE,updated
390+ """
391+ And STDERR should be empty
392+
393+ When I run `wp language theme uninstall twentyfifteen de_DE`
394+ And I run `wp theme install twentyfifteen --version=2.0 --force`
395+ And I run `wp language theme install twentyfifteen de_DE`
396+ And I run `wp theme install twentyfifteen --version=2.5 --force`
397+ And I run `wp language theme update twentyfifteen --format=summary`
398+ Then STDOUT should contain:
399+ """
400+ Success: Updated 1/1 translation.
401+ """
402+ And STDERR should be empty
403+
404+ @require-wp-4.0
405+ Scenario : Theme translation update with dry-run and format flag
406+ Given a WP install
407+ And an empty cache
408+
409+ When I run `wp theme install twentyfifteen --version=2.0 --force`
410+ Then STDERR should be empty
411+
412+ When I run `wp language theme install twentyfifteen de_DE`
413+ Then STDERR should be empty
414+
415+ When I run `wp theme install twentyfifteen --version=2.5 --force`
416+ And I run `wp language theme list twentyfifteen --fields=theme,language,update,status`
417+ Then STDOUT should be a table containing rows:
418+ | theme | language | update | status |
419+ | twentyfifteen | de_DE | available | installed |
420+
421+ When I run `wp language theme update twentyfifteen --dry-run --format=json`
422+ Then STDOUT should be JSON containing:
423+ """
424+ [{"Type":"Theme","Name":"Twenty Fifteen"}]
425+ """
426+ And STDERR should be empty
427+
428+ When I run `wp language theme update twentyfifteen --dry-run --format=csv`
429+ Then STDOUT should contain:
430+ """
431+ Type,Name,Version,Language
432+ """
433+ And STDOUT should contain:
434+ """
435+ Theme,"Twenty Fifteen"
436+ """
437+ And STDERR should be empty
438+
439+ When I run `wp language theme update twentyfifteen --dry-run --format=summary`
440+ Then STDOUT should be empty
441+ And STDERR should be empty
442+
330443 Scenario : Handle themes with text domain different from slug
331444 Given a WP install
332445 And an empty cache
0 commit comments