Changeset 52010 for trunk/tests/phpunit/tests/cron.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cron.php
r51916 r52010 17 17 private $plus_thirty_minutes; 18 18 19 function set_up() {19 public function set_up() { 20 20 parent::set_up(); 21 21 // Make sure the schedule is clear. … … 25 25 } 26 26 27 function tear_down() {27 public function tear_down() { 28 28 // Make sure the schedule is clear. 29 29 _set_cron_array( array() ); … … 31 31 } 32 32 33 function test_wp_get_schedule_empty() {33 public function test_wp_get_schedule_empty() { 34 34 // Nothing scheduled. 35 35 $hook = __FUNCTION__; … … 37 37 } 38 38 39 function test_schedule_event_single() {39 public function test_schedule_event_single() { 40 40 // Schedule an event and make sure it's returned by wp_next_scheduled(). 41 41 $hook = __FUNCTION__; … … 51 51 } 52 52 53 function test_schedule_event_single_args() {53 public function test_schedule_event_single_args() { 54 54 // Schedule an event with arguments and make sure it's returned by wp_next_scheduled(). 55 55 $hook = 'event'; … … 69 69 } 70 70 71 function test_schedule_event() {71 public function test_schedule_event() { 72 72 // Schedule an event and make sure it's returned by wp_next_scheduled(). 73 73 $hook = __FUNCTION__; … … 83 83 } 84 84 85 function test_schedule_event_args() {85 public function test_schedule_event_args() { 86 86 // Schedule an event and make sure it's returned by wp_next_scheduled(). 87 87 $hook = 'event'; … … 112 112 * @covers ::wp_schedule_event 113 113 */ 114 function test_wp_schedule_event_without_cron_option_does_not_throw_warning() {114 public function test_wp_schedule_event_without_cron_option_does_not_throw_warning() { 115 115 delete_option( 'cron' ); 116 116 … … 133 133 * @covers ::wp_schedule_single_event 134 134 */ 135 function test_wp_schedule_single_event_without_cron_option() {135 public function test_wp_schedule_single_event_without_cron_option() { 136 136 delete_option( 'cron' ); 137 137 … … 149 149 } 150 150 151 function test_unschedule_event() {151 public function test_unschedule_event() { 152 152 // Schedule an event and make sure it's returned by wp_next_scheduled(). 153 153 $hook = __FUNCTION__; … … 163 163 } 164 164 165 function test_clear_schedule() {165 public function test_clear_schedule() { 166 166 $hook = __FUNCTION__; 167 167 $args = array( 'arg1' ); … … 190 190 } 191 191 192 function test_clear_undefined_schedule() {192 public function test_clear_undefined_schedule() { 193 193 $hook = __FUNCTION__; 194 194 $args = array( 'arg1' ); … … 202 202 } 203 203 204 function test_clear_schedule_multiple_args() {204 public function test_clear_schedule_multiple_args() { 205 205 $hook = __FUNCTION__; 206 206 $args = array( 'arg1', 'arg2' ); … … 231 231 * @ticket 10468 232 232 */ 233 function test_clear_schedule_new_args() {233 public function test_clear_schedule_new_args() { 234 234 $hook = __FUNCTION__; 235 235 $args = array( 'arg1' ); … … 269 269 * @ticket 18997 270 270 */ 271 function test_unschedule_hook() {271 public function test_unschedule_hook() { 272 272 $hook = __FUNCTION__; 273 273 $args = array( rand_str() ); … … 289 289 } 290 290 291 function test_unschedule_undefined_hook() {291 public function test_unschedule_undefined_hook() { 292 292 $hook = __FUNCTION__; 293 293 $unrelated_hook = __FUNCTION__ . '_two'; … … 310 310 * @ticket 6966 311 311 */ 312 function test_duplicate_event() {312 public function test_duplicate_event() { 313 313 // Duplicate events close together should be skipped. 314 314 $hook = __FUNCTION__; … … 333 333 * @ticket 6966 334 334 */ 335 function test_not_duplicate_event() {335 public function test_not_duplicate_event() { 336 336 // Duplicate events far apart should work normally. 337 337 $hook = __FUNCTION__; … … 352 352 } 353 353 354 function test_not_duplicate_event_reversed() {354 public function test_not_duplicate_event_reversed() { 355 355 // Duplicate events far apart should work normally regardless of order. 356 356 $hook = __FUNCTION__; … … 377 377 * @ticket 32656 378 378 */ 379 function test_pre_schedule_event_filter() {379 public function test_pre_schedule_event_filter() { 380 380 $hook = __FUNCTION__; 381 381 $args = array( 'arg1' ); … … 385 385 $expected = _get_cron_array(); 386 386 387 add_filter( 'pre_schedule_event', array( $this, ' _filter_pre_schedule_event_filter' ), 10, 2 );387 add_filter( 'pre_schedule_event', array( $this, 'filter_pre_schedule_event_filter' ), 10, 2 ); 388 388 389 389 $this->assertTrue( wp_schedule_single_event( $ts1, $hook, $args ) ); … … 411 411 * Filter the scheduling of events to use the preflight array. 412 412 */ 413 function _filter_pre_schedule_event_filter( $null, $event ) {413 public function filter_pre_schedule_event_filter( $null, $event ) { 414 414 $key = md5( serialize( $event->args ) ); 415 415 … … 429 429 * @ticket 32656 430 430 */ 431 function test_pre_reschedule_event_filter() {431 public function test_pre_reschedule_event_filter() { 432 432 $hook = __FUNCTION__; 433 433 $ts1 = strtotime( '+30 minutes' ); … … 453 453 * @ticket 32656 454 454 */ 455 function test_pre_unschedule_event_filter() {455 public function test_pre_unschedule_event_filter() { 456 456 $hook = __FUNCTION__; 457 457 $ts1 = strtotime( '+30 minutes' ); … … 477 477 * @ticket 32656 478 478 */ 479 function test_pre_clear_scheduled_hook_filters() {479 public function test_pre_clear_scheduled_hook_filters() { 480 480 $hook = __FUNCTION__; 481 481 $ts1 = strtotime( '+30 minutes' ); … … 508 508 * @ticket 32656 509 509 */ 510 function test_pre_scheduled_event_hooks() {510 public function test_pre_scheduled_event_hooks() { 511 511 add_filter( 'pre_get_scheduled_event', array( $this, 'filter_pre_scheduled_event_hooks' ) ); 512 512 … … 525 525 } 526 526 527 function filter_pre_scheduled_event_hooks() {527 public function filter_pre_scheduled_event_hooks() { 528 528 return (object) array( 529 529 'hook' => 'preflight_event', … … 542 542 * @ticket 45976. 543 543 */ 544 function test_get_scheduled_event_singles() {544 public function test_get_scheduled_event_singles() { 545 545 $hook = __FUNCTION__; 546 546 $args = array( 'arg1' ); … … 585 585 * @ticket 45976. 586 586 */ 587 function test_get_scheduled_event_recurring() {587 public function test_get_scheduled_event_recurring() { 588 588 $hook = __FUNCTION__; 589 589 $args = array( 'arg1' ); … … 629 629 * @ticket 45976. 630 630 */ 631 function test_get_scheduled_event_false() {631 public function test_get_scheduled_event_false() { 632 632 $hook = __FUNCTION__; 633 633 $args = array( 'arg1' ); … … 654 654 * @ticket 44818 655 655 */ 656 function test_duplicate_past_event() {656 public function test_duplicate_past_event() { 657 657 $hook = __FUNCTION__; 658 658 $args = array( 'arg1' ); … … 681 681 * @ticket 44818 682 682 */ 683 function test_duplicate_near_future_event() {683 public function test_duplicate_near_future_event() { 684 684 $hook = __FUNCTION__; 685 685 $args = array( 'arg1' ); … … 709 709 * @ticket 44818 710 710 */ 711 function test_duplicate_future_event() {711 public function test_duplicate_future_event() { 712 712 $hook = __FUNCTION__; 713 713 $args = array( 'arg1' ); … … 733 733 * @ticket 44818 734 734 */ 735 function test_not_duplicate_future_event() {735 public function test_not_duplicate_future_event() { 736 736 $hook = __FUNCTION__; 737 737 $args = array( 'arg1' );
Note: See TracChangeset
for help on using the changeset viewer.