Verified Commit 9626da5a authored by Erick Hitter's avatar Erick Hitter
Browse files

Basic tests that internal events are scheduled properly

parent cac0dec6
......@@ -14,6 +14,16 @@ class WPCCR_Internal_Events_Test extends WP_UnitTestCase {
* Internal events should be scheduled
*/
function test_events() {
$this->assertTrue( true );
WP_Cron_Control_Revisited\Internal_Events::instance()->schedule_internal_events();
$events = \WP_Cron_Control_Revisited\collapse_events_array( get_option( 'cron' ) );
// Check that the plugin scheduled the expected number of events
$this->assertEquals( count( $events ), 3 );
// Confirm that the scheduled jobs came from the Internal Events class
foreach ( $events as $event ) {
$this->assertTrue( \WP_Cron_Control_Revisited\is_internal_event( $event['action'] ) );
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment