mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
This replaces the `$tag` variables with `$hook_name`, to match the core function signatures. Follow-up to [24/tests], [62/tests], [866/tests], [1294/tests], [38571], [50807]. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53804 602fd350-edb4-49c9-b593-d223f7449a82
28 lines
649 B
PHP
28 lines
649 B
PHP
<?php
|
|
|
|
/**
|
|
* Test the do_all_hook method of WP_Hook
|
|
*
|
|
* @group hooks
|
|
* @covers WP_Hook::do_all_hook
|
|
*/
|
|
class Tests_Hooks_DoAllHook extends WP_UnitTestCase {
|
|
|
|
public function test_do_all_hook_with_multiple_calls() {
|
|
$a = new MockAction();
|
|
$callback = array( $a, 'action' );
|
|
$hook = new WP_Hook();
|
|
$hook_name = 'all';
|
|
$priority = 1;
|
|
$accepted_args = 2;
|
|
$arg = 'all_arg';
|
|
|
|
$hook->add_filter( $hook_name, $callback, $priority, $accepted_args );
|
|
$args = array( $arg );
|
|
$hook->do_all_hook( $args );
|
|
$hook->do_all_hook( $args );
|
|
|
|
$this->assertSame( 2, $a->get_call_count() );
|
|
}
|
|
}
|