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
15 changes: 15 additions & 0 deletions features/cron-event.feature
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,18 @@ Feature: Manage WP Cron events
"""
Debug: Arguments:
"""

Scenario: Confirm that cron event run in debug mode shows the start of events
When I try `wp cron event run wp_version_check --debug=cron`
Then STDOUT should contain:
"""
Executed the cron event 'wp_version_check'
"""
And STDOUT should contain:
"""
Executed a total of 1 cron event
"""
And STDERR should contain:
"""
Debug: Beginning execution of cron event 'wp_version_check'
"""
1 change: 1 addition & 0 deletions src/Cron_Event_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ public function run( $args, $assoc_args ) {

$executed = 0;
foreach ( $events as $event ) {
WP_CLI::debug( sprintf( "Beginning execution of cron event '%s'.", $event->hook ), 'cron' );
$start = microtime( true );
$result = self::run_event( $event );
$total = round( microtime( true ) - $start, 3 );
Expand Down