You appear to be a bot. Output may be restricted
Description
Usage
Tests_Filters::test_remove_filter();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/filters.php
Lines:
1 to 20 of 20
public function test_remove_filter() { $a = new MockAction(); $tag = __FUNCTION__; $val = __FUNCTION__ . '_val'; add_filter( $tag, array( $a, 'filter' ) ); $this->assertSame( $val, apply_filters( $tag, $val ) ); // Make sure our hook was called correctly. $this->assertSame( 1, $a->get_call_count() ); $this->assertSame( array( $tag ), $a->get_tags() ); // Now remove the filter, do it again, and make sure it's not called this time. remove_filter( $tag, array( $a, 'filter' ) ); $this->assertSame( $val, apply_filters( $tag, $val ) ); $this->assertSame( 1, $a->get_call_count() ); $this->assertSame( array( $tag ), $a->get_tags() ); }