Changeset 51619 for trunk/tests/phpunit/tests/cron.php
- Timestamp:
- 08/16/2021 03:22:38 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/cron.php
r51568 r51619 99 99 100 100 $this->assertSame( $recur, wp_get_schedule( $hook, $args ) ); 101 101 } 102 103 104 /** 105 * Tests that a call to wp_schedule_event() on a site without any scheduled events 106 * does not result in a PHP deprecation warning on PHP 8.1 or higher. 107 * 108 * The warning that we should not see: 109 * `Deprecated: Automatic conversion of false to array is deprecated`. 110 * 111 * @ticket 53635 112 * 113 * @covers ::wp_schedule_event 114 */ 115 function test_wp_schedule_event_without_cron_option_does_not_throw_warning() { 116 delete_option( 'cron' ); 117 118 // Verify that the cause of the error is in place. 119 $this->assertFalse( _get_cron_array(), '_get_cron_array() does not return false' ); 120 121 $hook = __FUNCTION__; 122 $timestamp = strtotime( '+10 minutes' ); 123 124 // Add an event. 125 $this->assertTrue( wp_schedule_event( $timestamp, 'daily', $hook ) ); 102 126 } 103 127
Note: See TracChangeset
for help on using the changeset viewer.