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

    r51397 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 );
     
    2727        $hook          = new WP_Hook();
    2828        $tag           = __FUNCTION__;
    29         $priority      = rand( 1, 100 );
    30         $accepted_args = rand( 1, 100 );
     29        $priority      = 1;
     30        $accepted_args = 2;
    3131
    3232        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    4040        $hook          = new WP_Hook();
    4141        $tag           = __FUNCTION__;
    42         $priority      = rand( 1, 100 );
    43         $accepted_args = rand( 1, 100 );
     42        $priority      = 1;
     43        $accepted_args = 2;
    4444
    4545        $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     
    5454        $hook          = new WP_Hook();
    5555        $tag           = __FUNCTION__;
    56         $priority      = rand( 1, 100 );
    57         $accepted_args = rand( 1, 100 );
     56        $priority      = 1;
     57        $accepted_args = 2;
    5858
    5959        $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
     
    7070        $hook          = new WP_Hook();
    7171        $tag           = __FUNCTION__;
    72         $priority      = rand( 1, 100 );
    73         $accepted_args = rand( 1, 100 );
     72        $priority      = 1;
     73        $accepted_args = 2;
    7474
    7575        $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
Note: See TracChangeset for help on using the changeset viewer.