You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: WordPress/Tests/WP/CronIntervalUnitTest.inc
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -332,21 +332,20 @@ add_filter( 'cron_schedules', namespace\first_class_six_min_schedule(...)); // W
332
332
/*
333
333
* The tests below document the current behavior of the sniff, even though they are false negatives. The sniff treats
334
334
* the first-class callable examples below as if referencing the global function first_class_six_min_schedule()
335
-
* and not a namespaced function with the same name. Currently, those tests don't trigger a warning but instead
336
-
* they should trigger the `ChangeDetected` warning. Fixing this incorrect behavior is not trivial.
335
+
* and not a namespaced function with the same name.
337
336
*/
338
-
add_filter( 'cron_schedules', MyNamespace\first_class_weekly_schedule(...)); // Ok: > 15 min.
339
-
add_filter( 'cron_schedules', \MyNamespace\first_class_weekly_schedule(...)); // Ok: > 15 min.
337
+
add_filter( 'cron_schedules', MyNamespace\first_class_weekly_schedule(...)); // False negative - Ok: > 15 min, but should be marked `ChangeDetected`.
338
+
add_filter( 'cron_schedules', \MyNamespace\first_class_weekly_schedule(...)); // False negative - Ok: > 15 min, but should be marked `ChangeDetected`.
339
+
add_filter( 'cron_schedules', namespace\Sub\first_class_weekly_schedule(...)); // False negative - Ok: > 15 min, but should be marked `ChangeDetected`.
340
340
341
341
/*
342
342
* The tests below document the current behavior of the sniff, even though they are false positives. The sniff treats
343
343
* the first-class callable examples below as if referencing the global function first_class_six_min_schedule()
344
-
* and not a namespaced function with the same name. Currently, those tests trigger the `CronSchedulesInterval` warning
345
-
* but instead they should trigger the `ChangeDetected` warning. Fixing this incorrect behavior is not trivial.
344
+
* and not a namespaced function with the same name. Fixing this incorrect behavior is not trivial.
346
345
*/
347
-
add_filter( 'cron_schedules', MyNamespace\first_class_six_min_schedule(...)); // Warning: 6 min.
348
-
add_filter( 'cron_schedules', \MyNamespace\first_class_six_min_schedule(...)); // Warning: 6 min.
349
-
add_filter( 'cron_schedules', namespace\Sub\first_class_six_min_schedule(...)); // Warning: 6 min.
346
+
add_filter( 'cron_schedules', MyNamespace\first_class_six_min_schedule(...)); // False positive - `CronSchedulesInterval` warning (6 min), but should be `ChangeDetected`.
347
+
add_filter( 'cron_schedules', \MyNamespace\first_class_six_min_schedule(...)); // False positive - `CronSchedulesInterval` warning (6 min), but should be `ChangeDetected`.
348
+
add_filter( 'cron_schedules', namespace\Sub\first_class_six_min_schedule(...)); // False positive - `CronSchedulesInterval` warning (6 min), but should be `ChangeDetected`.
350
349
351
350
/*
352
351
* Safeguard correct handling of all types of namespaced function calls (except FQN global function call which is
0 commit comments