You appear to be a bot. Output may be restricted
Description
Usage
Tests_Hooks_ApplyFilters::test_apply_filters_with_callback();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/hooks/applyFilters.php
Lines:
1 to 17 of 17
public function test_apply_filters_with_callback() { $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 = $hook->apply_filters( $arg, array( $arg ) ); $this->assertSame( $returned, $arg ); $this->assertSame( 1, $a->get_call_count() ); }