Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 11 additions & 2 deletions features/plugin-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: List the status of plugins
<?php
"""

When I run `wp plugin status`
When I try `wp plugin status`
Then STDOUT should contain:
"""
D db-error.php
Expand All @@ -17,4 +17,13 @@ Feature: List the status of plugins
"""
D = Drop-In
"""
And STDERR should be empty

Scenario: Plugin status command is deprecated
Given a WP install

When I try `wp plugin status`
Then STDERR should contain:
"""
Warning: The `plugin status` command is deprecated. Use `wp plugin list` or `wp plugin get <plugin>` instead.
"""
And the return code should be 0
2 changes: 1 addition & 1 deletion features/plugin-uninstall.feature
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Feature: Uninstall a WordPress plugin
Scenario: Uninstalling a plugin should remove its update info
Given a WP install
And I run `wp plugin install wordpress-importer --version=0.6`
And I run `wp plugin status wordpress-importer`
And I try `wp plugin status wordpress-importer`

And I run `wp transient get --network update_plugins`
Then STDOUT should contain:
Expand Down
4 changes: 2 additions & 2 deletions features/plugin-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Feature: Update WordPress plugins
package from https://downloads.wordpress.org/plugin/wordpress-importer.0.5.zip...
"""

When I run `wp plugin status wordpress-importer`
When I try `wp plugin status wordpress-importer`
Then STDOUT should contain:
"""
Update available
Expand All @@ -72,7 +72,7 @@ Feature: Update WordPress plugins
wordpress-importer
"""

When I run `wp plugin status wordpress-importer`
When I try `wp plugin status wordpress-importer`
Then STDOUT should contain:
"""
Update available
Expand Down
10 changes: 5 additions & 5 deletions features/plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Manage WordPress plugins

# Check that the inner-plugin is not picked up
When I run `mv {PLUGIN_DIR}/plugin1 {PLUGIN_DIR}/Zombieland/`
And I run `wp plugin status Zombieland`
And I try `wp plugin status Zombieland`
Then STDOUT should contain:
"""
Plugin Zombieland details:
Expand All @@ -52,13 +52,13 @@ Feature: Manage WordPress plugins
When I run `wp plugin activate Zombieland`
Then STDOUT should not be empty

When I run `wp plugin status Zombieland`
When I try `wp plugin status Zombieland`
Then STDOUT should contain:
"""
Status: Active
"""

When I run `wp plugin status`
When I try `wp plugin status`
Then STDOUT should not be empty

When I run `wp plugin list --fields=name,status,update,version,update_version,auto_update`
Expand Down Expand Up @@ -198,7 +198,7 @@ Feature: Manage WordPress plugins
Success: Activated 1 of 1 plugins.
"""

When I run `wp plugin status network-only`
When I try `wp plugin status network-only`
Then STDOUT should contain:
"""
Status: Active
Expand All @@ -220,7 +220,7 @@ Feature: Manage WordPress plugins
Success: Activated 1 of 1 plugins.
"""

When I run `wp plugin status network-only`
When I try `wp plugin status network-only`
Then STDOUT should contain:
"""
Status: Network Active
Expand Down
26 changes: 20 additions & 6 deletions features/theme.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Feature: Manage WordPress themes

Scenario: Theme status command is deprecated
Given a WP install

When I try `wp theme status`
Then STDERR should contain:
"""
Warning: The `theme status` command is deprecated. Use `wp theme list` or `wp theme get <theme>` instead.
"""
And the return code should be 0

Scenario: Installing and deleting theme
Given a WP install
And I run `wp theme delete --all --force`
Expand All @@ -8,7 +18,7 @@ Feature: Manage WordPress themes
When I run `wp theme install twentytwelve`
Then STDOUT should not be empty

When I run `wp theme status twentytwelve`
When I try `wp theme status twentytwelve`
Then STDOUT should contain:
"""
Theme twentytwelve details:
Expand Down Expand Up @@ -64,7 +74,7 @@ Feature: Manage WordPress themes

When I run `wp theme install classic --activate`
And I run `wp theme list --field=name --status=inactive | xargs wp theme delete`
And I run `wp theme status`
And I try `wp theme status`
Then STDOUT should be:
"""
1 installed theme:
Expand Down Expand Up @@ -155,7 +165,7 @@ Feature: Manage WordPress themes
Success: Deleted
"""

When I run `wp theme status twentytwelve`
When I try `wp theme status twentytwelve`
Then STDOUT should contain:
"""
Update available
Expand All @@ -167,7 +177,7 @@ Feature: Manage WordPress themes
twentytwelve
"""

When I run `wp theme status twentytwelve`
When I try `wp theme status twentytwelve`
Then STDOUT should contain:
"""
Update available
Expand Down Expand Up @@ -305,6 +315,7 @@ Feature: Manage WordPress themes
When I try `wp theme status myth`
Then STDERR should be:
"""
Warning: The `theme status` command is deprecated. Use `wp theme list` or `wp theme get <theme>` instead.
Error: Stylesheet is missing.
"""
And STDOUT should be empty
Expand Down Expand Up @@ -558,12 +569,15 @@ Feature: Manage WordPress themes
This theme requires a parent theme. Checking if it is installed
"""

When I run `wp theme status moina`
When I try `wp theme status moina`
Then STDOUT should contain:
"""
Theme moina details:
"""
And STDERR should be empty
And STDERR should contain:
"""
Warning: The `theme status` command is deprecated. Use `wp theme list` or `wp theme get <theme>` instead.
"""

Scenario: Get status field in theme detail
Given a WP install
Expand Down
6 changes: 3 additions & 3 deletions features/upgradables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ Feature: Manage WordPress themes and plugins
["<item>"]
"""

When I run `wp <type> status`
When I try `wp <type> status`
Then STDOUT should contain:
"""
U = Update Available
"""

When I run `wp <type> status <item>`
When I try `wp <type> status <item>`
Then STDOUT should contain:
"""
Status: Inactive
Expand All @@ -104,7 +104,7 @@ Feature: Manage WordPress themes and plugins
updated
"""

When I run `wp <type> status <item>`
When I try `wp <type> status <item>`
Then STDOUT should not contain:
"""
(Update available)
Expand Down
2 changes: 2 additions & 0 deletions src/Plugin_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ protected function get_upgrader_class( $force ) {
* Version: 20160523.1
* Author: Otto42, pross
* Description: A simple and easy way to test your theme for all the latest WordPress standards and practices. A great theme development tool!
*
* @deprecated Use `wp plugin list` or `wp plugin get <plugin>` instead.
*/
public function status( $args ) {
parent::status( $args );
Expand Down
2 changes: 2 additions & 0 deletions src/Theme_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ protected function get_upgrader_class( $force ) {
* Status: Inactive
* Version: 1.2
* Author: the WordPress team
*
* @deprecated Use `wp theme list` or `wp theme get <theme>` instead.
Comment on lines +99 to +100

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the exact STDERR assertion for wp theme status myth

This case still expects only Error: Stylesheet is missing.; include the deprecation warning in the STDERR assertion as well.

Suggested test update
-    Then STDERR should be:
+    Then STDERR should contain:
+      """
+      Warning: The `theme status` command is deprecated. Use `wp theme list` or `wp theme get <theme>` instead.
+      """
+    And STDERR should contain:
       """
       Error: Stylesheet is missing.
       """
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Theme_Command.php` around lines 99 - 100, Update the STDERR assertion for
the `wp theme status myth` test to include both the existing “Stylesheet is
missing.” error and the deprecation warning from the `@deprecated` notice in
`src/Theme_Command.php`, preserving the expected output order.

*/
public function status( $args ) {
if ( isset( $args[0] ) ) {
Expand Down
Loading