Changeset 43571 for trunk/tests/phpunit/tests/post/nav-menu.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/nav-menu.php
r42732 r43571 23 23 24 24 wp_update_nav_menu_item( 25 $this->menu_id, 0, array( 25 $this->menu_id, 26 0, 27 array( 26 28 'menu-item-type' => 'taxonomy', 27 29 'menu-item-object' => 'post_tag', … … 50 52 51 53 $tag_insert = wp_update_nav_menu_item( 52 $this->menu_id, 0, array( 54 $this->menu_id, 55 0, 56 array( 53 57 'menu-item-type' => 'taxonomy', 54 58 'menu-item-object' => 'post_tag', … … 59 63 60 64 $cat_insert = wp_update_nav_menu_item( 61 $this->menu_id, 0, array( 65 $this->menu_id, 66 0, 67 array( 62 68 'menu-item-type' => 'taxonomy', 63 69 'menu-item-object' => 'category', … … 68 74 69 75 $post_insert = wp_update_nav_menu_item( 70 $this->menu_id, 0, array( 76 $this->menu_id, 77 0, 78 array( 71 79 'menu-item-type' => 'post_type', 72 80 'menu-item-object' => 'post', … … 78 86 // Item without menu-item-object arg 79 87 $post_2_insert = wp_update_nav_menu_item( 80 $this->menu_id, 0, array( 88 $this->menu_id, 89 0, 90 array( 81 91 'menu-item-type' => 'post_type', 82 92 'menu-item-object-id' => $post_2_id, … … 86 96 87 97 $page_insert = wp_update_nav_menu_item( 88 $this->menu_id, 0, array( 98 $this->menu_id, 99 0, 100 array( 89 101 'menu-item-type' => 'post_type', 90 102 'menu-item-object' => 'page', … … 133 145 // Create an orphan nav menu item 134 146 $custom_item_id = wp_update_nav_menu_item( 135 0, 0, array( 147 0, 148 0, 149 array( 136 150 'menu-item-type' => 'custom', 137 151 'menu-item-title' => 'Wordpress.org', … … 147 161 // Update the orphan with an associated nav menu 148 162 wp_update_nav_menu_item( 149 $this->menu_id, $custom_item_id, array( 163 $this->menu_id, 164 $custom_item_id, 165 array( 150 166 'menu-item-title' => 'WordPress.org', 151 167 ) … … 162 178 $t = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax' ) ); 163 179 $child_terms = self::factory()->term->create_many( 164 2, array( 180 2, 181 array( 165 182 'taxonomy' => 'wptests_tax', 166 183 'parent' => $t, … … 169 186 170 187 $term_menu_item = wp_update_nav_menu_item( 171 $this->menu_id, 0, array( 188 $this->menu_id, 189 0, 190 array( 172 191 'menu-item-type' => 'taxonomy', 173 192 'menu-item-object' => 'wptests_tax', … … 217 236 $expected_nav_menus_names = wp_list_pluck( 218 237 get_terms( 219 'nav_menu', array( 238 'nav_menu', 239 array( 220 240 'hide_empty' => false, 221 241 'orderby' => 'name', … … 239 259 $post_type_description = rand_str(); 240 260 register_post_type( 241 $post_type_slug, array( 261 $post_type_slug, 262 array( 242 263 'public' => true, 243 264 'has_archive' => true, … … 248 269 249 270 $post_type_archive_item_id = wp_update_nav_menu_item( 250 $this->menu_id, 0, array( 271 $this->menu_id, 272 0, 273 array( 251 274 'menu-item-type' => 'post_type_archive', 252 275 'menu-item-object' => $post_type_slug, … … 269 292 $post_type_description = ''; 270 293 register_post_type( 271 $post_type_slug, array( 294 $post_type_slug, 295 array( 272 296 'public' => true, 273 297 'has_archive' => true, … … 277 301 278 302 $post_type_archive_item_id = wp_update_nav_menu_item( 279 $this->menu_id, 0, array( 303 $this->menu_id, 304 0, 305 array( 280 306 'menu-item-type' => 'post_type_archive', 281 307 'menu-item-object' => $post_type_slug, … … 297 323 $post_type_description = rand_str(); 298 324 register_post_type( 299 $post_type_slug, array( 325 $post_type_slug, 326 array( 300 327 'public' => true, 301 328 'has_archive' => true, … … 308 335 309 336 $post_type_archive_item_id = wp_update_nav_menu_item( 310 $this->menu_id, 0, array( 337 $this->menu_id, 338 0, 339 array( 311 340 'menu-item-type' => 'post_type_archive', 312 341 'menu-item-object' => $post_type_slug, … … 329 358 330 359 $post_type_archive_item_id = wp_update_nav_menu_item( 331 $this->menu_id, 0, array( 360 $this->menu_id, 361 0, 362 array( 332 363 'menu-item-type' => 'post_type_archive', 333 364 'menu-item-object' => $post_type_slug, … … 351 382 352 383 $menu_item_id = wp_update_nav_menu_item( 353 $this->menu_id, 0, array( 384 $this->menu_id, 385 0, 386 array( 354 387 'menu-item-type' => 'post_type', 355 388 'menu-item-object' => 'post', … … 374 407 375 408 $post_insert = wp_update_nav_menu_item( 376 $this->menu_id, 0, array( 409 $this->menu_id, 410 0, 411 array( 377 412 'menu-item-type' => 'post_type', 378 413 'menu-item-object' => 'post', … … 383 418 384 419 $post_inser2 = wp_update_nav_menu_item( 385 $this->menu_id, 0, array( 420 $this->menu_id, 421 0, 422 array( 386 423 'menu-item-type' => 'post_type', 387 424 'menu-item-object' => 'post', … … 392 429 393 430 $post_insert3 = wp_update_nav_menu_item( 394 $this->menu_id, 0, array( 431 $this->menu_id, 432 0, 433 array( 395 434 'menu-item-type' => 'post_type', 396 435 'menu-item-object' => 'post', … … 402 441 403 442 $post_insert4 = wp_update_nav_menu_item( 404 $this->menu_id, 0, array( 443 $this->menu_id, 444 0, 445 array( 405 446 'menu-item-type' => 'post_type', 406 447 'menu-item-object' => 'post', … … 450 491 451 492 $tag_insert = wp_update_nav_menu_item( 452 $this->menu_id, 0, array( 493 $this->menu_id, 494 0, 495 array( 453 496 'menu-item-type' => 'taxonomy', 454 497 'menu-item-object' => 'post_tag', … … 541 584 542 585 wp_update_nav_menu_item( 543 $this->menu_id, 0, array( 586 $this->menu_id, 587 0, 588 array( 544 589 'menu-item-type' => 'post_type', 545 590 'menu-item-object' => 'page', … … 571 616 572 617 wp_update_nav_menu_item( 573 $this->menu_id, 0, array( 618 $this->menu_id, 619 0, 620 array( 574 621 'menu-item-type' => 'post_type', 575 622 'menu-item-object' => 'page', … … 612 659 613 660 wp_update_nav_menu_item( 614 $this->menu_id, 0, array( 661 $this->menu_id, 662 0, 663 array( 615 664 'menu-item-type' => 'taxonomy', 616 665 'menu-item-object' => 'post_tag', … … 690 739 691 740 register_post_type( 692 'books', array( 741 'books', 742 array( 693 743 'label' => 'Books', 694 744 'public' => true, … … 711 761 712 762 $first_menu_id = wp_update_nav_menu_item( 713 $this->menu_id, 0, array( 763 $this->menu_id, 764 0, 765 array( 714 766 'menu-item-type' => 'post_type', 715 767 'menu-item-object' => 'page', … … 720 772 721 773 $second_menu_id = wp_update_nav_menu_item( 722 $this->menu_id, 0, array( 774 $this->menu_id, 775 0, 776 array( 723 777 'menu-item-type' => 'post_type', 724 778 'menu-item-object' => 'page', … … 730 784 731 785 wp_update_nav_menu_item( 732 $this->menu_id, 0, array( 786 $this->menu_id, 787 0, 788 array( 733 789 'menu-item-type' => 'post_type_archive', 734 790 'menu-item-object' => 'books', … … 783 839 function test_iri_current_menu_item( $custom_link, $current = true ) { 784 840 wp_update_nav_menu_item( 785 $this->menu_id, 0, array( 841 $this->menu_id, 842 0, 843 array( 786 844 'menu-item-status' => 'publish', 787 845 'menu-item-type' => 'custom',
Note: See TracChangeset
for help on using the changeset viewer.