Skip to content

Commit 630089b

Browse files
author
Jeremy Ward
committed
Update test scenario - remove additional class import per feedback from Alain.
1 parent 6a0f6bf commit 630089b

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

features/command.feature

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,23 +1675,13 @@ Feature: WP-CLI Commands
16751675
// Plugin Name: Custom Command
16761676
16771677
add_action( 'cli_init', function() {
1678-
require_once plugin_dir_path( __FILE__ ) . '/class-custom-command.php';
1679-
$command = new Custom_Command();
1680-
WP_CLI::add_command( 'custom', array( $command, 'do_custom_command' ) );
1678+
WP_CLI::add_command( 'custom', 'do_custom_command' );
16811679
} );
1682-
"""
1683-
And a wp-content/plugins/custom-command/class-custom-command.php file:
1684-
"""
1685-
<?php
1686-
class Custom_Command extends WP_CLI_Command {
1687-
/**
1688-
* Tell the whole world!
1689-
*/
1690-
public function do_custom_command() {
1691-
WP_CLI::success( "This command doesn't really do much, does it?" );
1680+
1681+
function do_custom_command() {
1682+
WP_CLI::success( 'Triggered the callback for the custom command.' );
16921683
}
1693-
}
1694-
"""
1684+
"""
16951685
And I run `wp plugin activate custom-command`
16961686
When I run `wp custom --help`
16971687
Then STDOUT should contain:

0 commit comments

Comments
 (0)