You appear to be a bot. Output may be restricted
Description
Usage
Tests_Filters::test_simple_filter();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/filters.php
Lines:
1 to 18 of 18
public function test_simple_filter() { $a = new MockAction(); $tag = __FUNCTION__; $val = __FUNCTION__ . '_val'; add_filter( $tag, array( $a, 'filter' ) ); $this->assertSame( $val, apply_filters( $tag, $val ) ); // Only one event occurred for the hook, with empty args. $this->assertSame( 1, $a->get_call_count() ); // Only our hook was called. $this->assertSame( array( $tag ), $a->get_tags() ); $argsvar = $a->get_args(); $args = array_pop( $argsvar ); $this->assertSame( array( $val ), $args ); }