mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-02 16:20:05 +00:00
Tests: Update the test for pre_wp_setup_nav_menu_item filter.
This ensures that not only is the filter applied in `wp_setup_nav_menu_item()`, but also the actual output is tested. Follow-up to [55867], [55868]. Props azaozz, ugyensupport. Fixes #56577. git-svn-id: https://develop.svn.wordpress.org/trunk@55979 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -608,12 +608,11 @@ class Tests_Post_Nav_Menu extends WP_UnitTestCase {
|
||||
)
|
||||
);
|
||||
|
||||
$filter = new MockAction();
|
||||
add_filter( 'pre_wp_setup_nav_menu_item', array( &$filter, 'filter' ) );
|
||||
add_filter( 'pre_wp_setup_nav_menu_item', '__return_empty_string' );
|
||||
|
||||
wp_setup_nav_menu_item( get_post( $menu_item_id ) );
|
||||
$custom_item = wp_setup_nav_menu_item( get_post( $menu_item_id ) );
|
||||
|
||||
$this->assertSame( 1, $filter->get_call_count() );
|
||||
$this->assertSame( '', $custom_item );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user