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
97 changes: 52 additions & 45 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions features/command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ Feature: WP-CLI Commands

Scenario: Invalid subcommand of valid command
Given an empty directory
And a session_no file:
"""
n
"""
And a custom-cmd.php file:
"""
<?php
Expand All @@ -285,10 +289,10 @@ Feature: WP-CLI Commands
WP_CLI::add_command( 'command', 'Custom_Command_Class' );
"""

When I try `wp --require=custom-cmd.php command invalid`
When I try `wp --require=custom-cmd.php command invalid < session_no`
Then STDERR should contain:
"""
Error: 'invalid' is not a registered subcommand of 'command'. See 'wp help command' for available subcommands.
Warning: 'invalid' is not a registered subcommand of 'command'. See 'wp help command' for available subcommands.
"""

Scenario: Use a closure as a command
Expand Down Expand Up @@ -1149,21 +1153,25 @@ Feature: WP-CLI Commands

Scenario: WP-CLI suggests matching commands when user entry contains typos
Given a WP installation
And a session_no file:
"""
n
"""

When I try `wp clu`
Then STDERR should contain:
When I try `wp clu < session_no`
Then STDOUT should contain:
"""
Did you mean 'cli'?
"""

When I try `wp cli nfo`
Then STDERR should contain:
When I try `wp cli nfo < session_no`
Then STDOUT should contain:
"""
Did you mean 'info'?
"""

When I try `wp cli beyondlevenshteinthreshold`
Then STDERR should not contain:
Then STDOUT should not contain:
"""
Did you mean
"""
Expand Down