Make WordPress Core


Ignore:
Timestamp:
12/19/2021 01:42:37 PM (3 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/addFilter.php

    r50342 r52389  
    1616        $hook          = new WP_Hook();
    1717        $tag           = __FUNCTION__;
    18         $priority      = rand( 1, 100 );
    19         $accepted_args = rand( 1, 100 );
     18        $priority      = 1;
     19        $accepted_args = 2;
    2020
    2121        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    3131        $hook          = new WP_Hook();
    3232        $tag           = __FUNCTION__;
    33         $priority      = rand( 1, 100 );
    34         $accepted_args = rand( 1, 100 );
     33        $priority      = 1;
     34        $accepted_args = 2;
    3535
    3636        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    4545        $hook          = new WP_Hook();
    4646        $tag           = __FUNCTION__;
    47         $priority      = rand( 1, 100 );
    48         $accepted_args = rand( 1, 100 );
     47        $priority      = 1;
     48        $accepted_args = 2;
    4949
    5050        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    6060        $hook          = new WP_Hook();
    6161        $tag           = __FUNCTION__;
    62         $priority      = rand( 1, 100 );
    63         $accepted_args = rand( 1, 100 );
     62        $priority      = 1;
     63        $accepted_args = 2;
    6464
    6565        $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
     
    7575        $hook          = new WP_Hook();
    7676        $tag           = __FUNCTION__;
    77         $priority      = rand( 1, 100 );
    78         $accepted_args = rand( 1, 100 );
     77        $priority      = 1;
     78        $accepted_args = 2;
    7979
    8080        $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
     
    9090        $hook          = new WP_Hook();
    9191        $tag           = __FUNCTION__;
    92         $priority      = rand( 1, 100 );
    93         $accepted_args = rand( 1, 100 );
     92        $priority      = 1;
     93        $accepted_args = 2;
    9494
    9595        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    104104        $hook          = new WP_Hook();
    105105        $tag           = __FUNCTION__;
    106         $priority      = rand( 1, 100 );
    107         $accepted_args = rand( 1, 100 );
     106        $priority      = 1;
     107        $accepted_args = 2;
    108108
    109109        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
Note: See TracChangeset for help on using the changeset viewer.