wordpress-develop/tests/phpunit/tests/hooks/doAllHook.php
Sergey Biryukov 0ec5fb339b 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@53804 602fd350-edb4-49c9-b593-d223f7449a82
2022-07-31 15:03:46 +00:00

28 lines
649 B
PHP

<?php
/**
* Test the do_all_hook method of WP_Hook
*
* @group hooks
* @covers WP_Hook::do_all_hook
*/
class Tests_Hooks_DoAllHook extends WP_UnitTestCase {
public function test_do_all_hook_with_multiple_calls() {
$a = new MockAction();
$callback = array( $a, 'action' );
$hook = new WP_Hook();
$hook_name = 'all';
$priority = 1;
$accepted_args = 2;
$arg = 'all_arg';
$hook->add_filter( $hook_name, $callback, $priority, $accepted_args );
$args = array( $arg );
$hook->do_all_hook( $args );
$hook->do_all_hook( $args );
$this->assertSame( 2, $a->get_call_count() );
}
}