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/hasFilter.php

    r50342 r52389  
    1313        $hook          = new WP_Hook();
    1414        $tag           = __FUNCTION__;
    15         $priority      = rand( 1, 100 );
    16         $accepted_args = rand( 1, 100 );
     15        $priority      = 1;
     16        $accepted_args = 2;
    1717
    1818        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    2626        $hook          = new WP_Hook();
    2727        $tag           = __FUNCTION__;
    28         $priority      = rand( 1, 100 );
    29         $accepted_args = rand( 1, 100 );
     28        $priority      = 1;
     29        $accepted_args = 2;
    3030
    3131        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    3838        $hook          = new WP_Hook();
    3939        $tag           = __FUNCTION__;
    40         $priority      = rand( 1, 100 );
    41         $accepted_args = rand( 1, 100 );
     40        $priority      = 1;
     41        $accepted_args = 2;
    4242
    4343        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    5050        $hook          = new WP_Hook();
    5151        $tag           = __FUNCTION__;
    52         $priority      = rand( 1, 100 );
    53         $accepted_args = rand( 1, 100 );
     52        $priority      = 1;
     53        $accepted_args = 2;
    5454
    5555        $hook->add_filter( $tag, $callback, $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, $priority, $accepted_args );
Note: See TracChangeset for help on using the changeset viewer.