Changeset 38763 for trunk/tests/phpunit/tests/cron.php
- Timestamp:
- 10/09/2016 01:29:04 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cron.php
r38382 r38763 21 21 function test_wp_get_schedule_empty() { 22 22 // nothing scheduled 23 $hook = rand_str();23 $hook = __FUNCTION__; 24 24 $this->assertFalse(wp_get_schedule($hook)); 25 25 } … … 27 27 function test_schedule_event_single() { 28 28 // schedule an event and make sure it's returned by wp_next_scheduled 29 $hook = rand_str();29 $hook = __FUNCTION__; 30 30 $timestamp = strtotime('+1 hour'); 31 31 … … 57 57 function test_schedule_event() { 58 58 // schedule an event and make sure it's returned by wp_next_scheduled 59 $hook = rand_str();59 $hook = __FUNCTION__; 60 60 $recur = 'hourly'; 61 61 $timestamp = strtotime('+1 hour'); … … 88 88 function test_unschedule_event() { 89 89 // schedule an event and make sure it's returned by wp_next_scheduled 90 $hook = rand_str();90 $hook = __FUNCTION__; 91 91 $timestamp = strtotime('+1 hour'); 92 92 … … 100 100 101 101 function test_clear_schedule() { 102 $hook = rand_str();103 $args = array( rand_str());102 $hook = __FUNCTION__; 103 $args = array( 'arg1' ); 104 104 105 105 // schedule several events with and without arguments … … 126 126 127 127 function test_clear_schedule_multiple_args() { 128 $hook = rand_str();129 $args = array( rand_str(), rand_str());128 $hook = __FUNCTION__; 129 $args = array( 'arg1', 'arg2' ); 130 130 131 131 // schedule several events with and without arguments … … 155 155 */ 156 156 function test_clear_schedule_new_args() { 157 $hook = rand_str();158 $args = array( rand_str());159 $multi_hook = rand_str();160 $multi_args = array( rand_str(), rand_str());157 $hook = __FUNCTION__; 158 $args = array( 'arg1' ); 159 $multi_hook = __FUNCTION__ . '_multi'; 160 $multi_args = array( 'arg2', 'arg3' ); 161 161 162 162 // schedule several events with and without arguments … … 195 195 function test_duplicate_event() { 196 196 // duplicate events close together should be skipped 197 $hook = rand_str();198 $args = array( rand_str());197 $hook = __FUNCTION__; 198 $args = array( 'arg1' ); 199 199 $ts1 = strtotime('+5 minutes'); 200 200 $ts2 = strtotime('+3 minutes'); … … 214 214 function test_not_duplicate_event() { 215 215 // duplicate events far apart should work normally 216 $hook = rand_str();217 $args = array( rand_str());216 $hook = __FUNCTION__; 217 $args = array( 'arg1' ); 218 218 $ts1 = strtotime( '+30 minutes' ); 219 219 $ts2 = strtotime( '+3 minutes' ); … … 233 233 function test_not_duplicate_event_reversed() { 234 234 // duplicate events far apart should work normally regardless of order 235 $hook = rand_str();236 $args = array( rand_str());235 $hook = __FUNCTION__; 236 $args = array( 'arg1' ); 237 237 $ts1 = strtotime( '+3 minutes' ); 238 238 $ts2 = strtotime( '+30 minutes' ); … … 275 275 function test_run_schedule_single() { 276 276 // schedule an event, run it, and make sure the hook is called 277 $hook = rand_str();277 $hook = __FUNCTION__; 278 278 $args = array(rand_str()); 279 279 $timestamp = strtotime('-1 second'); … … 301 301 function test_run_schedule_recurring() { 302 302 // schedule a recurring event, run it, and make sure the hook is called 303 $hook = rand_str();303 $hook = __FUNCTION__; 304 304 $args = array(rand_str()); 305 305 $timestamp = strtotime('-1 second');
Note: See TracChangeset
for help on using the changeset viewer.