Make WordPress Core


Ignore:
Timestamp:
12/19/2021 01:42:37 PM (4 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Reduce the use of unnecessary randomness in tests.

This increases the overall reliability of the tests.

Props johnillo

Fixes #37371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/hooks/doAction.php

    r51568 r52389  
    2222        $hook          = new WP_Hook();
    2323        $tag           = __FUNCTION__;
    24         $priority      = rand( 1, 100 );
    25         $accepted_args = rand( 1, 100 );
     24        $priority      = 1;
     25        $accepted_args = 2;
    2626        $arg           = __FUNCTION__ . '_arg';
    2727
     
    3737        $hook          = new WP_Hook();
    3838        $tag           = __FUNCTION__;
    39         $priority      = rand( 1, 100 );
    40         $accepted_args = rand( 1, 100 );
     39        $priority      = 1;
     40        $accepted_args = 2;
    4141        $arg           = __FUNCTION__ . '_arg';
    4242
     
    5555        $hook          = new WP_Hook();
    5656        $tag           = __FUNCTION__;
    57         $priority      = rand( 1, 100 );
    58         $accepted_args = rand( 1, 100 );
     57        $priority      = 1;
     58        $accepted_args = 2;
    5959        $arg           = __FUNCTION__ . '_arg';
    6060
     
    7474        $hook          = new WP_Hook();
    7575        $tag           = __FUNCTION__;
    76         $priority      = rand( 1, 100 );
    77         $accepted_args = rand( 1, 100 );
     76        $priority      = 1;
     77        $accepted_args = 2;
    7878        $arg           = __FUNCTION__ . '_arg';
    7979
     
    9090        $hook          = new WP_Hook();
    9191        $tag           = __FUNCTION__;
    92         $priority      = rand( 1, 100 );
     92        $priority      = 1;
    9393        $accepted_args = 0;
    9494        $arg           = __FUNCTION__ . '_arg';
     
    104104        $hook          = new WP_Hook();
    105105        $tag           = __FUNCTION__;
    106         $priority      = rand( 1, 100 );
     106        $priority      = 1;
    107107        $accepted_args = 1;
    108108        $arg           = __FUNCTION__ . '_arg';
     
    118118        $hook          = new WP_Hook();
    119119        $tag           = __FUNCTION__;
    120         $priority      = rand( 1, 100 );
     120        $priority      = 100;
    121121        $accepted_args = 1000;
    122122        $arg           = __FUNCTION__ . '_arg';
Note: See TracChangeset for help on using the changeset viewer.