Make WordPress Core


Ignore:
Timestamp:
07/31/2022 03:03:46 PM (22 months ago)
Author:
SergeyBiryukov
Message:

Tests: Update the terminology used for action or filter names in hook tests.

This replaces the $tag variables with $hook_name, to match the core function signatures.

Follow-up to [24/tests], [62/tests], [866/tests], [1294/tests], [38571], [50807].

See #55652.

File:
1 edited

Legend:

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

    r52389 r53804  
    1313        $callback      = array( $a, 'filter' );
    1414        $hook          = new WP_Hook();
    15         $tag           = __FUNCTION__;
     15        $hook_name     = __FUNCTION__;
    1616        $priority      = 1;
    1717        $accepted_args = 2;
    1818        $arg           = __FUNCTION__ . '_arg';
    1919
    20         $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     20        $hook->add_filter( $hook_name, $callback, $priority, $accepted_args );
    2121
    2222        $returned = $hook->apply_filters( $arg, array( $arg ) );
     
    3030        $callback      = array( $a, 'filter' );
    3131        $hook          = new WP_Hook();
    32         $tag           = __FUNCTION__;
     32        $hook_name     = __FUNCTION__;
    3333        $priority      = 1;
    3434        $accepted_args = 2;
    3535        $arg           = __FUNCTION__ . '_arg';
    3636
    37         $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     37        $hook->add_filter( $hook_name, $callback, $priority, $accepted_args );
    3838
    3939        $returned_one = $hook->apply_filters( $arg, array( $arg ) );
Note: See TracChangeset for help on using the changeset viewer.