Make WordPress Core

Changeset 53564


Ignore:
Timestamp:
06/23/2022 08:41:22 PM (2 years ago)
Author:
azaozz
Message:

Build/Test Tools: Add missing @covers tags and fix the docs for the Cron test group.

Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See #39265.

Location:
trunk/tests/phpunit/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/cron.php

    r53492 r53564  
    3131    }
    3232
     33    /**
     34     * @covers ::wp_get_schedule
     35     */
    3336    public function test_wp_get_schedule_empty() {
    3437        // Nothing scheduled.
     
    3740    }
    3841
     42    /**
     43     * @covers ::wp_schedule_single_event
     44     */
    3945    public function test_schedule_event_single() {
    4046        // Schedule an event and make sure it's returned by wp_next_scheduled().
     
    5157    }
    5258
     59    /**
     60     * @covers ::wp_schedule_single_event
     61     */
    5362    public function test_schedule_event_single_args() {
    5463        // Schedule an event with arguments and make sure it's returned by wp_next_scheduled().
     
    6978    }
    7079
     80    /**
     81     * @covers ::wp_schedule_event
     82     */
    7183    public function test_schedule_event() {
    7284        // Schedule an event and make sure it's returned by wp_next_scheduled().
     
    8395    }
    8496
     97    /**
     98     * @covers ::wp_schedule_event
     99     */
    85100    public function test_schedule_event_args() {
    86101        // Schedule an event and make sure it's returned by wp_next_scheduled().
     
    103118    /**
    104119     * Tests that a call to wp_schedule_event() on a site without any scheduled events
    105      * does not result in a PHP deprecation notice on PHP 8.1 or higher.
    106      *
    107      * The notice that we should not see:
     120     * does not result in a PHP deprecation warning on PHP 8.1 or higher.
     121     *
     122     * The warning that we should not see:
    108123     * `Deprecated: Automatic conversion of false to array is deprecated`.
    109124     *
     
    112127     * @covers ::wp_schedule_event
    113128     */
    114     public function test_wp_schedule_event_without_cron_option_does_not_throw_deprecation_notice() {
     129    public function test_wp_schedule_event_without_cron_option_does_not_throw_warning() {
    115130        delete_option( 'cron' );
    116131
     
    149164    }
    150165
     166    /**
     167     * @covers ::wp_unschedule_event
     168     */
    151169    public function test_unschedule_event() {
    152170        // Schedule an event and make sure it's returned by wp_next_scheduled().
     
    163181    }
    164182
     183    /**
     184     * @covers ::wp_clear_scheduled_hook
     185     */
    165186    public function test_clear_schedule() {
    166187        $hook = __FUNCTION__;
     
    190211    }
    191212
     213    /**
     214     * @covers ::wp_clear_scheduled_hook
     215     */
    192216    public function test_clear_undefined_schedule() {
    193217        $hook = __FUNCTION__;
     
    202226    }
    203227
     228    /**
     229     * @covers ::wp_clear_scheduled_hook
     230     */
    204231    public function test_clear_schedule_multiple_args() {
    205232        $hook = __FUNCTION__;
     
    230257    /**
    231258     * @ticket 10468
     259     *
     260     * @covers ::wp_clear_scheduled_hook
    232261     */
    233262    public function test_clear_schedule_new_args() {
     
    268297    /**
    269298     * @ticket 18997
     299     *
     300     * @covers ::wp_unschedule_hook
    270301     */
    271302    public function test_unschedule_hook() {
     
    289320    }
    290321
     322    /**
     323     * @covers ::wp_unschedule_hook
     324     */
    291325    public function test_unschedule_undefined_hook() {
    292326        $hook           = __FUNCTION__;
     
    309343    /**
    310344     * @ticket 6966
     345     *
     346     * @covers ::wp_schedule_single_event
    311347     */
    312348    public function test_duplicate_event() {
     
    332368    /**
    333369     * @ticket 6966
     370     *
     371     * @covers ::wp_schedule_single_event
    334372     */
    335373    public function test_not_duplicate_event() {
     
    352390    }
    353391
     392    /**
     393     * @covers ::wp_schedule_single_event
     394     */
    354395    public function test_not_duplicate_event_reversed() {
    355396        // Duplicate events far apart should work normally regardless of order.
     
    376417     *
    377418     * @ticket 32656
     419     *
     420     * @covers ::wp_schedule_single_event
     421     * @covers ::wp_schedule_event
    378422     */
    379423    public function test_pre_schedule_event_filter() {
     
    428472     *
    429473     * @ticket 32656
     474     *
     475     * @covers ::wp_reschedule_event
    430476     */
    431477    public function test_pre_reschedule_event_filter() {
     
    452498     *
    453499     * @ticket 32656
     500     *
     501     * @covers ::wp_unschedule_event
    454502     */
    455503    public function test_pre_unschedule_event_filter() {
     
    476524     *
    477525     * @ticket 32656
     526     *
     527     * @covers ::wp_clear_scheduled_hook
     528     * @covers ::wp_unschedule_hook
    478529     */
    479530    public function test_pre_clear_scheduled_hook_filters() {
     
    507558     *
    508559     * @ticket 32656
     560     *
     561     * @covers ::wp_get_scheduled_event
     562     * @covers ::wp_next_scheduled
    509563     */
    510564    public function test_pre_scheduled_event_hooks() {
     
    541595     *
    542596     * @ticket 45976.
     597     *
     598     * @covers ::wp_get_scheduled_event
    543599     */
    544600    public function test_get_scheduled_event_singles() {
     
    584640     *
    585641     * @ticket 45976.
     642     *
     643     * @covers ::wp_get_scheduled_event
    586644     */
    587645    public function test_get_scheduled_event_recurring() {
     
    628686     *
    629687     * @ticket 45976.
     688     *
     689     * @covers ::wp_get_scheduled_event
    630690     */
    631691    public function test_get_scheduled_event_false() {
     
    653713     *
    654714     * @ticket 44818
     715     *
     716     * @covers ::wp_schedule_single_event
    655717     */
    656718    public function test_duplicate_past_event() {
     
    680742     *
    681743     * @ticket 44818
     744     *
     745     * @covers ::wp_schedule_single_event
    682746     */
    683747    public function test_duplicate_near_future_event() {
     
    708772     *
    709773     * @ticket 44818
     774     *
     775     * @covers ::wp_schedule_single_event
    710776     */
    711777    public function test_duplicate_future_event() {
     
    732798     *
    733799     * @ticket 44818
     800     *
     801     * @covers ::wp_schedule_single_event
    734802     */
    735803    public function test_not_duplicate_future_event() {
     
    750818    /**
    751819     * @ticket 49961
     820     *
     821     * @covers ::wp_schedule_single_event
     822     * @covers ::wp_schedule_event
     823     * @covers ::wp_reschedule_event
     824     * @covers ::wp_unschedule_event
    752825     */
    753826    public function test_invalid_timestamp_for_event_returns_error() {
     
    772845    /**
    773846     * @ticket 49961
     847     *
     848     * @covers ::wp_schedule_event
     849     * @covers ::wp_reschedule_event
    774850     */
    775851    public function test_invalid_recurrence_for_event_returns_error() {
     
    786862    /**
    787863     * @ticket 49961
     864     *
     865     * @covers ::wp_schedule_single_event
     866     * @covers ::wp_schedule_event
     867     * @covers ::wp_reschedule_event
    788868     */
    789869    public function test_disallowed_event_returns_false_when_wp_error_is_set_to_false() {
     
    801881    /**
    802882     * @ticket 49961
     883     *
     884     * @covers ::wp_schedule_single_event
     885     * @covers ::wp_schedule_event
     886     * @covers ::wp_reschedule_event
    803887     */
    804888    public function test_disallowed_event_returns_error_when_wp_error_is_set_to_true() {
     
    821905    /**
    822906     * @ticket 49961
     907     *
     908     * @covers ::wp_schedule_single_event
     909     * @covers ::wp_schedule_event
     910     * @covers ::wp_reschedule_event
    823911     */
    824912    public function test_schedule_short_circuit_with_error_returns_false_when_wp_error_is_set_to_false() {
     
    849937    /**
    850938     * @ticket 49961
     939     *
     940     * @covers ::wp_schedule_single_event
     941     * @covers ::wp_schedule_event
     942     * @covers ::wp_reschedule_event
    851943     */
    852944    public function test_schedule_short_circuit_with_error_returns_error_when_wp_error_is_set_to_true() {
     
    882974    /**
    883975     * @ticket 49961
     976     *
     977     * @covers ::wp_schedule_single_event
     978     * @covers ::wp_schedule_event
     979     * @covers ::wp_reschedule_event
    884980     */
    885981    public function test_schedule_short_circuit_with_false_returns_false_when_wp_error_is_set_to_false() {
     
    901997    /**
    902998     * @ticket 49961
     999     *
     1000     * @covers ::wp_schedule_single_event
     1001     * @covers ::wp_schedule_event
     1002     * @covers ::wp_reschedule_event
    9031003     */
    9041004    public function test_schedule_short_circuit_with_false_returns_error_when_wp_error_is_set_to_true() {
     
    9261026     * @ticket 49961
    9271027     * @expectedDeprecated wp_clear_scheduled_hook
     1028     *
     1029     * @covers ::wp_clear_scheduled_hook
    9281030     */
    9291031    public function test_deprecated_argument_usage_of_wp_clear_scheduled_hook() {
     
    9441046    /**
    9451047     * @ticket 49961
     1048     *
     1049     * @covers ::wp_clear_scheduled_hook
    9461050     */
    9471051    public function test_clear_scheduled_hook_returns_default_pre_filter_error_when_wp_error_is_set_to_true() {
     
    9651069    /**
    9661070     * @ticket 49961
     1071     *
     1072     * @covers ::wp_clear_scheduled_hook
    9671073     */
    9681074    public function test_clear_scheduled_hook_returns_custom_pre_filter_error_when_wp_error_is_set_to_true() {
     
    9981104    /**
    9991105     * @ticket 49961
     1106     *
     1107     * @covers ::wp_unschedule_hook
    10001108     */
    10011109    public function test_unschedule_short_circuit_with_error_returns_false_when_wp_error_is_set_to_false() {
     
    10211129    /**
    10221130     * @ticket 49961
     1131     *
     1132     * @covers ::wp_unschedule_hook
    10231133     */
    10241134    public function test_unschedule_short_circuit_with_error_returns_error_when_wp_error_is_set_to_true() {
     
    10451155    /**
    10461156     * @ticket 49961
     1157     *
     1158     * @covers ::wp_unschedule_hook
    10471159     */
    10481160    public function test_unschedule_short_circuit_with_false_returns_false_when_wp_error_is_set_to_false() {
     
    10591171    /**
    10601172     * @ticket 49961
     1173     *
     1174     * @covers ::wp_unschedule_hook
    10611175     */
    10621176    public function test_unschedule_short_circuit_with_false_returns_error_when_wp_error_is_set_to_true() {
     
    10741188    /**
    10751189     * @ticket 49961
     1190     *
     1191     * @covers ::wp_schedule_single_event
    10761192     */
    10771193    public function test_cron_array_error_is_returned_when_scheduling_single_event() {
     
    10941210    /**
    10951211     * @ticket 49961
     1212     *
     1213     * @covers ::wp_schedule_event
    10961214     */
    10971215    public function test_cron_array_error_is_returned_when_scheduling_event() {
     
    11141232    /**
    11151233     * @ticket 49961
     1234     *
     1235     * @covers ::wp_unschedule_hook
    11161236     */
    11171237    public function test_cron_array_error_is_returned_when_unscheduling_hook() {
     
    11381258    /**
    11391259     * @ticket 49961
     1260     *
     1261     * @covers ::wp_unschedule_event
    11401262     */
    11411263    public function test_cron_array_error_is_returned_when_unscheduling_event() {
  • trunk/tests/phpunit/tests/cron/setCronArray.php

    r53492 r53564  
    2525     *
    2626     * Includes verifying that invalid input - typically `false` - does not result in a PHP
    27      * deprecation notice on PHP 8.1 or higher.
     27     * deprecation warning on PHP 8.1 or higher.
    2828     *
    29      * The notice that we should not see:
     29     * The warning that we should not see:
    3030     * `Deprecated: Automatic conversion of false to array is deprecated`.
    3131     *
Note: See TracChangeset for help on using the changeset viewer.