Changeset 27556 for trunk/tests/phpunit/tests/post/nav-menu.php
- Timestamp:
- 03/15/2014 06:06:41 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/nav-menu.php
r27150 r27556 89 89 $this->assertEqualSets( array(), $page_items ); 90 90 } 91 92 /** 93 * @ticket 27113 94 */ 95 function test_orphan_nav_menu_item() { 96 97 // Create an orphan nav menu item 98 $custom_item_id = wp_update_nav_menu_item( 0, 0, array( 99 'menu-item-type' => 'custom', 100 'menu-item-title' => 'Wordpress.org', 101 'menu-item-link' => 'http://wordpress.org', 102 'menu-item-status' => 'publish' 103 ) ); 104 105 // Confirm it saved properly 106 $custom_item = wp_setup_nav_menu_item( get_post( $custom_item_id ) ); 107 $this->assertEquals( 'Wordpress.org', $custom_item->title ); 108 109 // Update the orphan with an associated nav menu 110 wp_update_nav_menu_item( $this->menu_id, $custom_item_id, array( 111 'menu-item-title' => 'WordPress.org', 112 ) ); 113 $menu_items = wp_get_nav_menu_items( $this->menu_id ); 114 $custom_item = wp_filter_object_list( $menu_items, array( 'db_id' => $custom_item_id ) ); 115 $custom_item = array_pop( $custom_item ); 116 $this->assertEquals( 'WordPress.org', $custom_item->title ); 117 118 } 91 119 }
Note: See TracChangeset
for help on using the changeset viewer.