You appear to be a bot. Output may be restricted
Description
Usage
Tests_Actions::test_remove_action();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/actions.php
Lines:
1 to 19 of 19
public function test_remove_action() { $a = new MockAction(); $tag = __FUNCTION__; add_action( $tag, 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( $tag, array( &$a, 'action' ) ); do_action( $tag ); $this->assertSame( 1, $a->get_call_count() ); $this->assertSame( array( $tag ), $a->get_tags() ); }