Add a unit test for `wp_nav_menu()` with `container => ''`

See #32464.



git-svn-id: https://develop.svn.wordpress.org/trunk@35736 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-11-25 18:18:37 +00:00
parent d1ec5b6ac3
commit dc167a20e5
1 changed files with 22 additions and 0 deletions

View File

@ -15,6 +15,28 @@ class Test_Nav_Menus extends WP_UnitTestCase {
$this->menu_id = wp_create_nav_menu( rand_str() ); $this->menu_id = wp_create_nav_menu( rand_str() );
} }
/**
* @ticket 32464
*/
public function test_wp_nav_menu_empty_container() {
$tag_id = self::factory()->tag->create();
wp_update_nav_menu_item( $this->menu_id, 0, array(
'menu-item-type' => 'taxonomy',
'menu-item-object' => 'post_tag',
'menu-item-object-id' => $tag_id,
'menu-item-status' => 'publish'
) );
$menu = wp_nav_menu( array(
'echo' => false,
'container' => '',
'menu' => $this->menu_id
) );
$this->assertEquals( 0, strpos( $menu, '<ul' ) );
}
function test_wp_get_associated_nav_menu_items() { function test_wp_get_associated_nav_menu_items() {
$tag_id = self::factory()->tag->create(); $tag_id = self::factory()->tag->create();
$cat_id = self::factory()->category->create(); $cat_id = self::factory()->category->create();