Make WordPress Core


Ignore:
Timestamp:
07/31/2022 03:03:46 PM (3 years 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/removeAllFilters.php

    r52389 r53804  
    1212        $callback      = '__return_null';
    1313        $hook          = new WP_Hook();
    14         $tag           = __FUNCTION__;
     14        $hook_name     = __FUNCTION__;
    1515        $priority      = 1;
    1616        $accepted_args = 2;
    1717
    18         $hook->add_filter( $tag, $callback, $priority, $accepted_args );
     18        $hook->add_filter( $hook_name, $callback, $priority, $accepted_args );
    1919
    2020        $hook->remove_all_filters();
     
    2727        $callback_two  = '__return_false';
    2828        $hook          = new WP_Hook();
    29         $tag           = __FUNCTION__;
     29        $hook_name     = __FUNCTION__;
    3030        $priority      = 1;
    3131        $accepted_args = 2;
    3232
    33         $hook->add_filter( $tag, $callback_one, $priority, $accepted_args );
    34         $hook->add_filter( $tag, $callback_two, $priority + 1, $accepted_args );
     33        $hook->add_filter( $hook_name, $callback_one, $priority, $accepted_args );
     34        $hook->add_filter( $hook_name, $callback_two, $priority + 1, $accepted_args );
    3535
    3636        $hook->remove_all_filters( $priority );
    3737
    38         $this->assertFalse( $hook->has_filter( $tag, $callback_one ) );
     38        $this->assertFalse( $hook->has_filter( $hook_name, $callback_one ) );
    3939        $this->assertTrue( $hook->has_filters() );
    40         $this->assertSame( $priority + 1, $hook->has_filter( $tag, $callback_two ) );
     40        $this->assertSame( $priority + 1, $hook->has_filter( $hook_name, $callback_two ) );
    4141    }
    4242}
Note: See TracChangeset for help on using the changeset viewer.