WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/09/2016 01:29:04 AM (4 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Continue eliminating randomness in tests.

See [38762]
See #37371

File:
1 edited

Legend:

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

    r38382 r38763  
    2121    function test_wp_get_schedule_empty() {
    2222        // nothing scheduled
    23         $hook = rand_str();
     23        $hook = __FUNCTION__;
    2424        $this->assertFalse(wp_get_schedule($hook));
    2525    }
     
    2727    function test_schedule_event_single() {
    2828        // schedule an event and make sure it's returned by wp_next_scheduled
    29         $hook = rand_str();
     29        $hook = __FUNCTION__;
    3030        $timestamp = strtotime('+1 hour');
    3131
     
    5757    function test_schedule_event() {
    5858        // schedule an event and make sure it's returned by wp_next_scheduled
    59         $hook = rand_str();
     59        $hook = __FUNCTION__;
    6060        $recur = 'hourly';
    6161        $timestamp = strtotime('+1 hour');
     
    8888    function test_unschedule_event() {
    8989        // schedule an event and make sure it's returned by wp_next_scheduled
    90         $hook = rand_str();
     90        $hook = __FUNCTION__;
    9191        $timestamp = strtotime('+1 hour');
    9292
     
    100100
    101101    function test_clear_schedule() {
    102         $hook = rand_str();
    103         $args = array(rand_str());
     102        $hook = __FUNCTION__;
     103        $args = array( 'arg1' );
    104104
    105105        // schedule several events with and without arguments
     
    126126
    127127    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' );
    130130
    131131        // schedule several events with and without arguments
     
    155155     */
    156156    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' );
    161161
    162162        // schedule several events with and without arguments
     
    195195    function test_duplicate_event() {
    196196        // duplicate events close together should be skipped
    197         $hook = rand_str();
    198         $args = array(rand_str());
     197        $hook = __FUNCTION__;
     198        $args = array( 'arg1' );
    199199        $ts1 = strtotime('+5 minutes');
    200200        $ts2 = strtotime('+3 minutes');
     
    214214    function test_not_duplicate_event() {
    215215        // duplicate events far apart should work normally
    216         $hook = rand_str();
    217         $args = array( rand_str() );
     216        $hook = __FUNCTION__;
     217        $args = array( 'arg1' );
    218218        $ts1 = strtotime( '+30 minutes' );
    219219        $ts2 = strtotime( '+3 minutes' );
     
    233233    function test_not_duplicate_event_reversed() {
    234234        // 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' );
    237237        $ts1 = strtotime( '+3 minutes' );
    238238        $ts2 = strtotime( '+30 minutes' );
     
    275275    function test_run_schedule_single() {
    276276        // schedule an event, run it, and make sure the hook is called
    277         $hook = rand_str();
     277        $hook = __FUNCTION__;
    278278        $args = array(rand_str());
    279279        $timestamp = strtotime('-1 second');
     
    301301    function test_run_schedule_recurring() {
    302302        // schedule a recurring event, run it, and make sure the hook is called
    303         $hook = rand_str();
     303        $hook = __FUNCTION__;
    304304        $args = array(rand_str());
    305305        $timestamp = strtotime('-1 second');
Note: See TracChangeset for help on using the changeset viewer.