Changeset 43571 for trunk/tests/phpunit/tests/term/wpUpdateTerm.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpUpdateTerm.php
r42343 r43571 28 28 29 29 $found = wp_update_term( 30 $t, 'wptests_tax', array( 30 $t, 31 'wptests_tax', 32 array( 31 33 'name' => 'Let\\\'s all say \\"Hooray\\" for WordPress taxonomy', 32 34 ) … … 48 50 49 51 $found = wp_update_term( 50 $t, 'wptests_tax', array( 52 $t, 53 'wptests_tax', 54 array( 51 55 'description' => 'Let\\\'s all say \\"Hooray\\" for WordPress taxonomy', 52 56 ) … … 68 72 69 73 $found = wp_update_term( 70 $t, 'wptests_tax', array( 74 $t, 75 'wptests_tax', 76 array( 71 77 'name' => '', 72 78 ) … … 83 89 function test_wp_update_term_parent_does_not_exist() { 84 90 register_taxonomy( 85 'wptests_tax', array( 91 'wptests_tax', 92 array( 86 93 'hierarchical' => true, 87 94 ) … … 98 105 99 106 $found = wp_update_term( 100 $t, 'wptests_tax', array( 107 $t, 108 'wptests_tax', 109 array( 101 110 'parent' => $fake_term_id, 102 111 ) … … 121 130 122 131 $found = wp_update_term( 123 $t, 'wptests_tax', array( 132 $t, 133 'wptests_tax', 134 array( 124 135 'slug' => '', 125 136 ) … … 140 151 141 152 $found = wp_update_term( 142 $t, 'wptests_tax', array( 153 $t, 154 'wptests_tax', 155 array( 143 156 'name' => 'Foo Bar', 144 157 'slug' => '', … … 160 173 161 174 $found = wp_update_term( 162 $t, 'wptests_tax', array( 175 $t, 176 'wptests_tax', 177 array( 163 178 'slug' => 'foo-bar', 164 179 ) … … 193 208 194 209 $updated = wp_update_term( 195 $t2, 'wptests_tax', array( 210 $t2, 211 'wptests_tax', 212 array( 196 213 'slug' => 'foo', 197 214 ) … … 226 243 227 244 $updated = wp_update_term( 228 $t2, 'wptests_tax_2', array( 245 $t2, 246 'wptests_tax_2', 247 array( 229 248 'slug' => 'foo', 230 249 ) … … 262 281 263 282 $updated = wp_update_term( 264 $t2, 'wptests_tax_2', array( 283 $t2, 284 'wptests_tax_2', 285 array( 265 286 'name' => 'Foo', 266 287 ) … … 278 299 public function test_wp_update_term_should_allow_duplicate_names_at_different_levels_of_the_same_taxonomy() { 279 300 register_taxonomy( 280 'wptests_tax', 'post', array( 301 'wptests_tax', 302 'post', 303 array( 281 304 'hierarchical' => true, 282 305 ) … … 310 333 311 334 $updated = wp_update_term( 312 $t3, 'wptests_tax', array( 335 $t3, 336 'wptests_tax', 337 array( 313 338 'name' => 'Bar', 314 339 ) … … 352 377 353 378 wp_update_term( 354 $t2_terms[0]->term_id, 'wptests_tax_2', array( 379 $t2_terms[0]->term_id, 380 'wptests_tax_2', 381 array( 355 382 'name' => 'New Foo', 356 383 ) … … 373 400 $created_term_ids = wp_insert_term( 'Foo', 'wptests_tax' ); 374 401 wp_update_term( 375 $created_term_ids['term_id'], 'wptests_tax', array( 402 $created_term_ids['term_id'], 403 'wptests_tax', 404 array( 376 405 'alias_of' => $term_1->slug, 377 406 ) … … 406 435 $created_term_ids = wp_insert_term( 'Foo', 'wptests_tax' ); 407 436 wp_update_term( 408 $created_term_ids['term_id'], 'wptests_tax', array( 437 $created_term_ids['term_id'], 438 'wptests_tax', 439 array( 409 440 'alias_of' => $term_2->slug, 410 441 ) … … 421 452 $created_term_ids = wp_insert_term( 'Foo', 'wptests_tax' ); 422 453 wp_update_term( 423 $created_term_ids['term_id'], 'wptests_tax', array( 454 $created_term_ids['term_id'], 455 'wptests_tax', 456 array( 424 457 'alias_of' => 'bar', 425 458 ) … … 441 474 442 475 $found = wp_update_term( 443 $t, 'wptests_tax', array( 476 $t, 477 'wptests_tax', 478 array( 444 479 'slug' => 'foo', 445 480 ) … … 469 504 470 505 $found = wp_update_term( 471 $t2, 'wptests_tax', array( 506 $t2, 507 'wptests_tax', 508 array( 472 509 'slug' => '', 473 510 'name' => 'Foo? Bar!', // Will sanitize to 'foo-bar'. … … 484 521 public function test_wp_update_term_duplicate_slug_with_changed_parent() { 485 522 register_taxonomy( 486 'wptests_tax', 'post', array( 523 'wptests_tax', 524 'post', 525 array( 487 526 'hierarchical' => true, 488 527 ) … … 506 545 507 546 $found = wp_update_term( 508 $t2, 'wptests_tax', array( 547 $t2, 548 'wptests_tax', 549 array( 509 550 'parent' => $p, 510 551 'slug' => 'foo-bar', … … 536 577 537 578 $found = wp_update_term( 538 $t2, 'wptests_tax', array( 579 $t2, 580 'wptests_tax', 581 array( 539 582 'slug' => 'foo-bar', 540 583 ) … … 557 600 ); 558 601 $found = wp_update_term( 559 $t, 'wptests_tax', array( 602 $t, 603 'wptests_tax', 604 array( 560 605 'slug' => 'foo', 561 606 ) … … 587 632 ); 588 633 $found = wp_update_term( 589 $t, 'wptests_tax', array( 634 $t, 635 'wptests_tax', 636 array( 590 637 'slug' => 'foo', 591 638 ) … … 598 645 public function test_wp_update_term_should_clean_term_cache() { 599 646 register_taxonomy( 600 'wptests_tax', 'post', array( 647 'wptests_tax', 648 'post', 649 array( 601 650 'hierarchical' => true, 602 651 ) … … 624 673 625 674 $found = wp_update_term( 626 $t1, 'wptests_tax', array( 675 $t1, 676 'wptests_tax', 677 array( 627 678 'parent' => $t2, 628 679 ) … … 643 694 public function test_wp_update_term_should_assign_new_slug_when_reassigning_parent_as_long_as_there_is_no_other_term_with_the_same_slug() { 644 695 register_taxonomy( 645 'wptests_tax', 'post', array( 696 'wptests_tax', 697 'post', 698 array( 646 699 'hierarchical' => true, 647 700 ) 648 701 ); 649 702 register_taxonomy( 650 'wptests_tax_2', 'post', array( 703 'wptests_tax_2', 704 'post', 705 array( 651 706 'hierarchical' => true, 652 707 ) … … 668 723 669 724 wp_update_term( 670 $t2, 'wptests_tax', array( 725 $t2, 726 'wptests_tax', 727 array( 671 728 'parent' => $t1, 672 729 ) … … 685 742 public function test_wp_update_term_should_not_assign_new_slug_when_reassigning_parent_as_long_as_there_is_no_other_slug_conflict_within_the_taxonomy() { 686 743 register_taxonomy( 687 'wptests_tax', 'post', array( 744 'wptests_tax', 745 'post', 746 array( 688 747 'hierarchical' => true, 689 748 ) 690 749 ); 691 750 register_taxonomy( 692 'wptests_tax_2', 'post', array( 751 'wptests_tax_2', 752 'post', 753 array( 693 754 'hierarchical' => true, 694 755 ) … … 718 779 719 780 wp_update_term( 720 $t3, 'wptests_tax', array( 781 $t3, 782 'wptests_tax', 783 array( 721 784 'parent' => $t1, 722 785 )
Note: See TracChangeset
for help on using the changeset viewer.