You appear to be a bot. Output may be restricted
Description
Usage
Tests_Hooks_DoAction::test_do_action_with_multiple_callbacks_on_different_priorities();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/hooks/doAction.php
Lines:
1 to 19 of 19
public function test_do_action_with_multiple_callbacks_on_different_priorities() { $a = new MockAction(); $b = new MockAction(); $callback_one = array( $a, 'filter' ); $callback_two = array( $b, 'filter' ); $hook = new WP_Hook(); $tag = __FUNCTION__; $priority = rand( 1, 100 ); $accepted_args = rand( 1, 100 ); $arg = __FUNCTION__ . '_arg'; $hook->add_filter( $tag, $callback_one, $priority, $accepted_args ); $hook->add_filter( $tag, $callback_two, $priority + 1, $accepted_args ); $hook->do_action( array( $arg ) ); $this->assertSame( 1, $a->get_call_count() ); $this->assertSame( 1, $a->get_call_count() ); }