Changeset 43571 for trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
r42343 r43571 25 25 // make sure they're correct 26 26 $terms = wp_get_object_terms( 27 $post_id, $this->taxonomy, array( 27 $post_id, 28 $this->taxonomy, 29 array( 28 30 'fields' => 'slugs', 29 31 'orderby' => 'term_id', … … 49 51 50 52 $terms2 = wp_get_object_terms( 51 array( $post_id1, $post_id2 ), 'category', array( 53 array( $post_id1, $post_id2 ), 54 'category', 55 array( 52 56 'fields' => 'all_with_object_id', 53 57 ) … … 138 142 139 143 $found = wp_get_object_terms( 140 $p, $this->taxonomy, array( 144 $p, 145 $this->taxonomy, 146 array( 141 147 'orderby' => 'name', 142 148 'fields' => 'ids', … … 174 180 175 181 $found = wp_get_object_terms( 176 $posts[0], $this->taxonomy, array( 182 $posts[0], 183 $this->taxonomy, 184 array( 177 185 'orderby' => 'count', 178 186 'fields' => 'ids', … … 208 216 209 217 $found = wp_get_object_terms( 210 $p, $this->taxonomy, array( 218 $p, 219 $this->taxonomy, 220 array( 211 221 'orderby' => 'slug', 212 222 'fields' => 'ids', … … 245 255 246 256 $found = wp_get_object_terms( 247 $p, $this->taxonomy, array( 257 $p, 258 $this->taxonomy, 259 array( 248 260 'orderby' => 'term_group', 249 261 'fields' => 'ids', … … 282 294 global $wpdb; 283 295 $wpdb->update( 284 $wpdb->term_relationships, array( 'term_order' => 1 ), array( 296 $wpdb->term_relationships, 297 array( 'term_order' => 1 ), 298 array( 285 299 'term_taxonomy_id' => $term_1->term_taxonomy_id, 286 300 'object_id' => $p, … … 288 302 ); 289 303 $wpdb->update( 290 $wpdb->term_relationships, array( 'term_order' => 3 ), array( 304 $wpdb->term_relationships, 305 array( 'term_order' => 3 ), 306 array( 291 307 'term_taxonomy_id' => $term_2->term_taxonomy_id, 292 308 'object_id' => $p, … … 294 310 ); 295 311 $wpdb->update( 296 $wpdb->term_relationships, array( 'term_order' => 2 ), array( 312 $wpdb->term_relationships, 313 array( 'term_order' => 2 ), 314 array( 297 315 'term_taxonomy_id' => $term_3->term_taxonomy_id, 298 316 'object_id' => $p, … … 301 319 302 320 $found = wp_get_object_terms( 303 $p, $this->taxonomy, array( 321 $p, 322 $this->taxonomy, 323 array( 304 324 'orderby' => 'term_order', 305 325 'fields' => 'ids', … … 344 364 345 365 $found = wp_get_object_terms( 346 $p, $this->taxonomy, array( 366 $p, 367 $this->taxonomy, 368 array( 347 369 'orderby' => 'parent', 348 370 'fields' => 'ids', … … 383 405 384 406 $found = wp_get_object_terms( 385 $p, array( $this->taxonomy, 'wptests_tax_2', 'wptests_tax_3' ), array( 407 $p, 408 array( $this->taxonomy, 'wptests_tax_2', 'wptests_tax_3' ), 409 array( 386 410 'orderby' => 'taxonomy', 387 411 'fields' => 'ids', … … 427 451 428 452 $found = wp_get_object_terms( 429 $p, $this->taxonomy, array( 453 $p, 454 $this->taxonomy, 455 array( 430 456 'orderby' => 'term_taxonomy_id', 431 457 'fields' => 'ids', … … 461 487 462 488 $found = wp_get_object_terms( 463 $p, $this->taxonomy, array( 489 $p, 490 $this->taxonomy, 491 array( 464 492 'orderby' => 'name', 465 493 'order' => 'DESC', … … 476 504 public function test_parent() { 477 505 register_taxonomy( 478 'wptests_tax2', 'post', array( 506 'wptests_tax2', 507 'post', 508 array( 479 509 'hierarchical' => true, 480 510 ) … … 509 539 510 540 $found = wp_get_object_terms( 511 $p, 'wptests_tax2', array( 541 $p, 542 'wptests_tax2', 543 array( 512 544 'parent' => $t1, 513 545 'fields' => 'ids', … … 550 582 551 583 $found = wp_get_object_terms( 552 $p, $this->taxonomy, array( 584 $p, 585 $this->taxonomy, 586 array( 553 587 'parent' => 0, 554 588 'fields' => 'ids', … … 601 635 602 636 $found = wp_get_object_terms( 603 $p, 'wptests_tax', array( 637 $p, 638 'wptests_tax', 639 array( 604 640 'update_term_meta_cache' => false, 605 641 ) … … 631 667 632 668 $found = wp_get_object_terms( 633 $p, 'wptests_tax', array( 669 $p, 670 'wptests_tax', 671 array( 634 672 'update_term_meta_cache' => true, 635 673 'fields' => 'all_with_object_id', … … 662 700 663 701 $found = wp_get_object_terms( 664 $p, 'wptests_tax', array( 702 $p, 703 'wptests_tax', 704 array( 665 705 'update_term_meta_cache' => true, 666 706 'fields' => 'ids', … … 692 732 693 733 $found = wp_get_object_terms( 694 $p, 'wptests_tax', array( 734 $p, 735 'wptests_tax', 736 array( 695 737 'meta_query' => array( 696 738 array( … … 715 757 716 758 $found = wp_get_object_terms( 717 $p, 'wptests_tax', array( 759 $p, 760 'wptests_tax', 761 array( 718 762 'fields' => 'all', 719 763 ) … … 736 780 737 781 $found = wp_get_object_terms( 738 $p, 'wptests_tax', array( 782 $p, 783 'wptests_tax', 784 array( 739 785 'fields' => 'all_with_object_id', 740 786 ) … … 759 805 760 806 $found = wp_get_object_terms( 761 $p, 'wptests_tax', array( 807 $p, 808 'wptests_tax', 809 array( 762 810 'fields' => 'all_with_object_id', 763 811 ) … … 779 827 780 828 $found = wp_get_object_terms( 781 $p, 'wptests_tax', array( 829 $p, 830 'wptests_tax', 831 array( 782 832 'fields' => 'all_with_object_id', 783 833 ) … … 807 857 808 858 $found = wp_get_object_terms( 809 $p, array( 859 $p, 860 array( 810 861 'wptests_tax1', 811 862 'wptests_tax2', 812 ), array( 863 ), 864 array( 813 865 'fields' => 'all_with_object_id', 814 866 ) … … 834 886 835 887 $found = wp_get_object_terms( 836 $posts, 'wptests_tax', array( 888 $posts, 889 'wptests_tax', 890 array( 837 891 'fields' => 'all_with_object_id', 838 892 ) … … 938 992 939 993 $actual = wp_get_object_terms( 940 $post_id, array( $taxonomy1, $taxonomy2 ), array( 994 $post_id, 995 array( $taxonomy1, $taxonomy2 ), 996 array( 941 997 'orderby' => 'term_id', 942 998 'fields' => 'ids',
Note: See TracChangeset
for help on using the changeset viewer.