Changeset 51916 for trunk/tests/phpunit/tests/cron.php
- Timestamp:
- 10/18/2021 12:51:00 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cron.php
r51657 r51916 101 101 } 102 102 103 104 103 /** 105 104 * Tests that a call to wp_schedule_event() on a site without any scheduled events … … 124 123 // Add an event. 125 124 $this->assertTrue( wp_schedule_event( $timestamp, 'daily', $hook ) ); 125 } 126 127 /** 128 * Tests that a call to wp_schedule_single_event() on a site without any scheduled events 129 * does not result in the value "false" being added into the cron array. 130 * 131 * @ticket 53950 132 * 133 * @covers ::wp_schedule_single_event 134 */ 135 function test_wp_schedule_single_event_without_cron_option() { 136 delete_option( 'cron' ); 137 138 // Verify that the cause of the error is in place. 139 $this->assertFalse( _get_cron_array(), '_get_cron_array() does not return false' ); 140 141 $hook = __FUNCTION__; 142 $timestamp = strtotime( '+10 minutes' ); 143 144 // Add an event. 145 $this->assertTrue( wp_schedule_single_event( $timestamp, $hook ), 'Scheduling single event failed' ); 146 147 // Verify that "false" is not a value in the final cron array. 148 $this->assertNotContains( false, get_option( 'cron' ), 'Resulting cron array contains the value "false"' ); 126 149 } 127 150
Note: See TracChangeset
for help on using the changeset viewer.