diff --git a/features/cron-event.feature b/features/cron-event.feature index 45884455..9ddda281 100644 --- a/features/cron-event.feature +++ b/features/cron-event.feature @@ -91,16 +91,21 @@ Feature: Manage WP Cron events Scenario: Run cron event with a registered shutdown function Given a wp-content/mu-plugins/setup_shutdown_function.php file: """ - add_action('mycron', function() { - breakthings(); - }); - - register_shutdown_function(function() { - $error = error_get_last(); - if ($error['type'] === E_ERROR) { - WP_CLI::line('MY SHUTDOWN FUNCTION'); - } - }); + add_action( + 'mycron', + function () { + breakthings(); + } + ); + + register_shutdown_function( + function () { + $error = error_get_last(); + if ( $error['type'] === E_ERROR ) { + WP_CLI::line( 'MY SHUTDOWN FUNCTION' ); + } + } + ); """ When I run `wp cron event schedule mycron now` @@ -114,13 +119,18 @@ Feature: Manage WP Cron events Given a wp-content/mu-plugins/setup_shutdown_function_log.php file: """ 3600, - 'display' => __( 'Every Hour' ), - ); - return $schedules; - } + 'cron_schedules', + function ( $schedules ) { + $schedules['test_schedule'] = array( + 'interval' => 3600, + 'display' => __( 'Every Hour' ), + ); + return $schedules; + } ); """ @@ -235,11 +235,14 @@ Feature: Manage WP-Cron events and schedules And a wp-content/mu-plugins/set_cron_site_url.php file: """ array( - 'postindexer_secondpass_cron' => array( - '40cd750bba9870f18aada2478b24840a' => array( - 'schedule' => '5mins', - 'args' => array(), - 'interval' => 100, - ), + 1647914509 => array( + 'postindexer_secondpass_cron' => array( + '40cd750bba9870f18aada2478b24840a' => array( + 'schedule' => '5mins', + 'args' => array(), + 'interval' => 100, + ), + ), + ), + 'wp_batch_split_terms' => array( + 1442323165 => array( + '40cd750bba9870f18aada2478b24840a' => array( + 'schedule' => false, + 'args' => array(), + ), + ), ), - ), - 'wp_batch_split_terms' => array( - 1442323165 => array( - '40cd750bba9870f18aada2478b24840a' => array( - 'schedule' => false, - 'args' => array() - ) - ) - ) ); update_option( 'cron', $val ); """