Changeset 35225 for trunk/tests/phpunit/tests/post/nav-menu.php
- Timestamp:
- 10/16/2015 09:04:12 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/nav-menu.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/nav-menu.php
r32294 r35225 17 17 18 18 function test_wp_get_associated_nav_menu_items() { 19 $tag_id = $this->factory->tag->create();20 $cat_id = $this->factory->category->create();21 $post_id = $this->factory->post->create();22 $post_2_id = $this->factory->post->create();23 $page_id = $this->factory->post->create( array( 'post_type' => 'page' ) );19 $tag_id = self::$factory->tag->create(); 20 $cat_id = self::$factory->category->create(); 21 $post_id = self::$factory->post->create(); 22 $post_2_id = self::$factory->post->create(); 23 $page_id = self::$factory->post->create( array( 'post_type' => 'page' ) ); 24 24 25 25 $tag_insert = wp_update_nav_menu_item( $this->menu_id, 0, array( … … 108 108 109 109 // Update the orphan with an associated nav menu 110 wp_update_nav_menu_item( $this->menu_id, $custom_item_id, array( 110 wp_update_nav_menu_item( $this->menu_id, $custom_item_id, array( 111 111 'menu-item-title' => 'WordPress.org', 112 112 ) ); … … 120 120 public function test_wp_get_nav_menu_items_with_taxonomy_term() { 121 121 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 122 $t = $this->factory->term->create( array( 'taxonomy' => 'wptests_tax' ) );123 $child_terms = $this->factory->term->create_many( 2, array( 'taxonomy' => 'wptests_tax', 'parent' => $t ) );122 $t = self::$factory->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 123 $child_terms = self::$factory->term->create_many( 2, array( 'taxonomy' => 'wptests_tax', 'parent' => $t ) ); 124 124 125 125 $term_menu_item = wp_update_nav_menu_item( $this->menu_id, 0, array( … … 141 141 */ 142 142 function test_orderby_name_by_default() { 143 // We are going to create a random number of menus (min 2, max 10) 143 // We are going to create a random number of menus (min 2, max 10) 144 144 $menus_no = rand( 2, 10 ); 145 145 … … 149 149 150 150 // This is the expected array of menu names 151 $expected_nav_menus_names = wp_list_pluck( 151 $expected_nav_menus_names = wp_list_pluck( 152 152 get_terms( 'nav_menu', array( 'hide_empty' => false, 'orderby' => 'name' ) ), 153 153 'name' … … 156 156 // And this is what we got when calling wp_get_nav_menus() 157 157 $nav_menus_names = wp_list_pluck( wp_get_nav_menus(), 'name' ); 158 158 159 159 $this->assertEquals( $nav_menus_names, $expected_nav_menus_names ); 160 160 }
Note: See TracChangeset
for help on using the changeset viewer.