You appear to be a bot. Output may be restricted
Description
Usage
Tests_Hooks_ApplyFilters::test_apply_filters_with_multiple_calls();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/hooks/applyFilters.php
Lines:
1 to 18 of 18
public function test_apply_filters_with_multiple_calls() { $a = new MockAction(); $callback = array( $a, 'filter' ); $hook = new WP_Hook(); $tag = __FUNCTION__; $priority = rand( 1, 100 ); $accepted_args = rand( 1, 100 ); $arg = __FUNCTION__ . '_arg'; $hook->add_filter( $tag, $callback, $priority, $accepted_args ); $returned_one = $hook->apply_filters( $arg, array( $arg ) ); $returned_two = $hook->apply_filters( $returned_one, array( $returned_one ) ); $this->assertSame( $returned_two, $arg ); $this->assertSame( 2, $a->get_call_count() ); }