Make WordPress Core


Ignore:
Timestamp:
12/19/2021 01:42:37 PM (5 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/hasFilters.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 );
    … …  
    3030                $hook          = new WP_Hook();
    3131                $tag           = __FUNCTION__;
    32                 $priority      = rand( 1, 100 );
    33                 $accepted_args = rand( 1, 100 );
     32                $priority      = 1;
     33                $accepted_args = 2;
    3434
    3535                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
    … …  
    4242                $hook          = new WP_Hook();
    4343                $tag           = __FUNCTION__;
    44                 $priority      = rand( 1, 100 );
    45                 $accepted_args = rand( 1, 100 );
     44                $priority      = 1;
     45                $accepted_args = 2;
    4646
    4747                $hook->add_filter( $tag, $callback, $priority, $accepted_args );
Note: See TracChangeset for help on using the changeset viewer.