@@ -207,6 +207,7 @@ Feature: Manage WordPress themes
207207 And STDOUT should be empty
208208 And the return code should be 0
209209
210+ @require-wp-5.3
210211 Scenario : Flag `--skip-update-check` skips update check when running `wp theme list`
211212 Given a WP install
212213
@@ -218,8 +219,8 @@ Feature: Manage WordPress themes
218219
219220 When I run `wp theme list --fields=name,status,update`
220221 Then STDOUT should be a table containing rows:
221- | name | status | update |
222- | astra | inactive | available |
222+ | name | status | update |
223+ | astra | inactive | available |
223224
224225 When I run `wp transient delete update_themes --network`
225226 Then STDOUT should be:
@@ -229,8 +230,8 @@ Feature: Manage WordPress themes
229230
230231 When I run `wp theme list --fields=name,status,update --skip-update-check`
231232 Then STDOUT should be a table containing rows:
232- | name | status | update |
233- | astra | inactive | none |
233+ | name | status | update |
234+ | astra | inactive | none |
234235
235236 Scenario : Install a theme when the theme directory doesn't yet exist
236237 Given a WP install
@@ -284,6 +285,7 @@ Feature: Manage WordPress themes
284285 Theme updated successfully.
285286 """
286287
288+ @require-wp-5.7
287289 Scenario : Enabling and disabling a theme
288290 Given a WP multisite install
289291 And I run `wp theme install moina`
@@ -379,6 +381,7 @@ Feature: Manage WordPress themes
379381 And STDOUT should be empty
380382 And the return code should be 1
381383
384+ @require-wp-5.7
382385 Scenario : Install and attempt to activate a child theme without its parent
383386 Given a WP install
384387 And I run `wp theme install moina-blog`
@@ -392,6 +395,7 @@ Feature: Manage WordPress themes
392395 And STDOUT should be empty
393396 And the return code should be 1
394397
398+ @require-wp-5.7
395399 Scenario : List an active theme with its parent
396400 Given a WP install
397401 And I run `wp theme install moina`
@@ -470,6 +474,7 @@ Feature: Manage WordPress themes
470474 twentytwelve,1.0,{UPDATE_VERSION},Updated
471475 """
472476
477+ @require-wp-5.7
473478 Scenario : Automatically install parent theme for a child theme
474479 Given a WP install
475480
@@ -579,7 +584,7 @@ Feature: Manage WordPress themes
579584 Error: Parameter errors:
580585 Invalid value specified for 'status' (Filter the output by theme status.)
581586 """
582-
587+ @require-wp-5.7
583588 Scenario : Parent theme is active when its child is active
584589 Given a WP install
585590 And I run `wp theme delete --all --force`
@@ -620,3 +625,91 @@ Feature: Manage WordPress themes
620625 Then STDOUT should be a table containing rows:
621626 | auto_update |
622627 | on |
628+
629+ Scenario : Show theme update as unavailable if it doesn't meet WordPress requirements
630+ Given a WP install
631+ And a wp-content/themes/example/style.css file:
632+ """
633+ /*
634+ Theme Name: example
635+ Version: 1.0.0
636+ */
637+ """
638+ And a wp-content/themes/example/index.php file:
639+ """
640+ <?php
641+ // Silence is golden.
642+ """
643+
644+ Given that HTTP requests to https://api.wordpress.org/themes/update-check/1.1/ will respond with:
645+ """
646+ HTTP/1.1 200 OK
647+
648+ {
649+ "themes": {
650+ "example": {
651+ "theme": "example",
652+ "new_version": "2.0.0",
653+ "requires": "100",
654+ "requires_php": "5.6"
655+ }
656+ },
657+ "translations": [],
658+ "no_update": []
659+ }
660+ """
661+
662+ And I run `wp theme list`
663+ Then STDOUT should be a table containing rows:
664+ | name | status | update | version | update_version | auto_update | requires | requires_php |
665+ | example | inactive | unavailable | 1 .0 .0 | 2 .0 .0 | off | 100 | 5 .6 |
666+
667+ When I try `wp theme update example`
668+ Then STDERR should contain:
669+ """
670+ Warning: example: This update requires WordPress version 100
671+ """
672+
673+ Scenario : Show theme update as unavailable if it doesn't meet PHP requirements
674+ Given a WP install
675+ And a wp-content/themes/example/style.css file:
676+ """
677+ /*
678+ Theme Name: example
679+ Version: 1.0.0
680+ */
681+ """
682+ And a wp-content/themes/example/index.php file:
683+ """
684+ <?php
685+ // Silence is golden.
686+ """
687+
688+ Given that HTTP requests to https://api.wordpress.org/themes/update-check/1.1/ will respond with:
689+ """
690+ HTTP/1.1 200 OK
691+
692+ {
693+ "themes": {
694+ "example": {
695+ "theme": "example",
696+ "new_version": "2.0.0",
697+ "requires": "3.7",
698+ "requires_php": "100"
699+ }
700+ },
701+ "translations": [],
702+ "no_update": []
703+ }
704+ """
705+
706+ And I run `wp theme list`
707+ Then STDOUT should be a table containing rows:
708+ | name | status | update | version | update_version | auto_update | requires | requires_php |
709+ | example | inactive | unavailable | 1 .0 .0 | 2 .0 .0 | off | 3 .7 | 100 |
710+
711+ When I try `wp theme update example`
712+ Then STDERR should contain:
713+ """
714+ Warning: example: This update requires PHP version 100
715+ """
0 commit comments