You appear to be a bot. Output may be restricted
Description
Usage
Tests_Actions::test_remove_all_action();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/actions.php
Lines:
1 to 20 of 20
public function test_remove_all_action() { $a = new MockAction(); $tag = __FUNCTION__; add_action( 'all', array( &$a, 'action' ) ); $this->assertSame( 10, has_filter( 'all', array( &$a, 'action' ) ) ); do_action( $tag ); // Make sure our hook was called correctly. $this->assertSame( 1, $a->get_call_count() ); $this->assertSame( array( $tag ), $a->get_tags() ); // Now remove the action, do it again, and make sure it's not called this time. remove_action( 'all', array( &$a, 'action' ) ); $this->assertFalse( has_filter( 'all', array( &$a, 'action' ) ) ); do_action( $tag ); $this->assertSame( 1, $a->get_call_count() ); $this->assertSame( array( $tag ), $a->get_tags() ); }