You appear to be a bot. Output may be restricted
Description
Usage
Tests_Actions::test_all_action();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/actions.php
Lines:
1 to 24 of 24
public function test_all_action() { $a = new MockAction(); $tag1 = __FUNCTION__ . '_1'; $tag2 = __FUNCTION__ . '_2'; // Add an 'all' action. add_action( 'all', array( &$a, 'action' ) ); $this->assertSame( 10, has_filter( 'all', array( &$a, 'action' ) ) ); // Do some actions. do_action( $tag1 ); do_action( $tag2 ); do_action( $tag1 ); do_action( $tag1 ); // Our action should have been called once for each tag. $this->assertSame( 4, $a->get_call_count() ); // Only our hook was called. $this->assertSame( array( $tag1, $tag2, $tag1, $tag1 ), $a->get_tags() ); remove_action( 'all', array( &$a, 'action' ) ); $this->assertFalse( has_filter( 'all', array( &$a, 'action' ) ) ); }