Changeset 48939 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 09/04/2020 07:01:00 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r48937 r48939 34 34 ); 35 35 36 $this->assert EqualSets( array( $term1 ), wp_list_pluck( $found, 'term_id' ) );36 $this->assertSameSets( array( $term1 ), wp_list_pluck( $found, 'term_id' ) ); 37 37 } 38 38 … … 53 53 ); 54 54 55 $this->assert EqualSets( array( $term ), $found );55 $this->assertSameSets( array( $term ), $found ); 56 56 } 57 57 … … 66 66 $found = get_terms( 'wptests_tax', 'hide_empty=0&fields=ids&update_term_meta_cache=0' ); 67 67 68 $this->assert EqualSets( array( $term ), $found );68 $this->assertSameSets( array( $term ), $found ); 69 69 } 70 70 … … 79 79 $found = get_terms( 'taxonomy=wptests_tax&hide_empty=0&fields=ids&update_term_meta_cache=0' ); 80 80 81 $this->assert EqualSets( array( $term ), $found );81 $this->assertSameSets( array( $term ), $found ); 82 82 } 83 83 … … 244 244 ) 245 245 ); 246 $this->assert EqualSets( array( $term_id1, $term_id2 ), $terms_ids );246 $this->assertSameSets( array( $term_id1, $term_id2 ), $terms_ids ); 247 247 248 248 $terms_name = get_terms( … … 253 253 ) 254 254 ); 255 $this->assert EqualSets( array( 'WOO!', 'HOO!' ), $terms_name );255 $this->assertSameSets( array( 'WOO!', 'HOO!' ), $terms_name ); 256 256 257 257 $terms_id_name = get_terms( … … 420 420 ) 421 421 ); 422 $this->assert EqualSets( array( $term_id1, $term_id2 ), $terms );422 $this->assertSameSets( array( $term_id1, $term_id2 ), $terms ); 423 423 } 424 424 … … 448 448 ) 449 449 ); 450 $this->assert EqualSets( array( $term_id1 ), $terms );450 $this->assertSameSets( array( $term_id1 ), $terms ); 451 451 452 452 $terms2 = get_terms( … … 458 458 ) 459 459 ); 460 $this->assert EqualSets( array( $term_id1, $term_id2 ), $terms2 );460 $this->assertSameSets( array( $term_id1, $term_id2 ), $terms2 ); 461 461 462 462 $terms3 = get_terms( … … 468 468 ) 469 469 ); 470 $this->assert EqualSets( array( $term_id1 ), $terms3 );470 $this->assertSameSets( array( $term_id1 ), $terms3 ); 471 471 472 472 $terms4 = get_terms( … … 478 478 ) 479 479 ); 480 $this->assert EqualSets( array( $term_id1, $term_id2 ), $terms4 );480 $this->assertSameSets( array( $term_id1, $term_id2 ), $terms4 ); 481 481 482 482 $terms5 = get_terms( … … 508 508 ) 509 509 ); 510 $this->assert EqualSets( array( $term_id1, $term_id2 ), $terms7 );510 $this->assertSameSets( array( $term_id1, $term_id2 ), $terms7 ); 511 511 512 512 $terms8 = get_terms( … … 518 518 ) 519 519 ); 520 $this->assert EqualSets( array( $term_id1, $term_id2 ), $terms8 );520 $this->assertSameSets( array( $term_id1, $term_id2 ), $terms8 ); 521 521 } 522 522 … … 846 846 ); 847 847 848 $this->assert EqualSets( array( $t3 ), $found );848 $this->assertSameSets( array( $t3 ), $found ); 849 849 } 850 850 … … 883 883 $result = _get_term_children( $c1, array( $c1, $c2, $c3 ), 'category' ); 884 884 885 $this->assert EqualSets( array( $c2, $c3 ), $result );885 $this->assertSameSets( array( $c2, $c3 ), $result ); 886 886 } 887 887 … … 902 902 $result = _get_term_children( $c1->term_id, array( $c1, $c2, $c3 ), 'category' ); 903 903 904 $this->assert EqualSets( array( $c2, $c3 ), $result );904 $this->assertSameSets( array( $c2, $c3 ), $result ); 905 905 } 906 906 … … 977 977 ); 978 978 979 $this->assert EqualSets( array( $t3, $t1 ), $found );979 $this->assertSameSets( array( $t3, $t1 ), $found ); 980 980 } 981 981 … … 1002 1002 ) 1003 1003 ); 1004 $this->assert EqualSets( array( $t ), $found );1004 $this->assertSameSets( array( $t ), $found ); 1005 1005 1006 1006 // Array format. … … 1013 1013 ) 1014 1014 ); 1015 $this->assert EqualSets( array( $t ), $found );1015 $this->assertSameSets( array( $t ), $found ); 1016 1016 } 1017 1017 … … 1044 1044 ); 1045 1045 1046 $this->assert EqualSets( array( $t ), $found );1046 $this->assertSameSets( array( $t ), $found ); 1047 1047 } 1048 1048 … … 1083 1083 1084 1084 $expected = array( $australia, $china, $tanzania ); 1085 $this->assert EqualSets( $expected, $terms );1085 $this->assertSameSets( $expected, $terms ); 1086 1086 } 1087 1087 … … 1175 1175 ); 1176 1176 1177 $this->assert EqualSets( array( $montreal, $nepean, $toronto, $pei ), $terms );1177 $this->assertSameSets( array( $montreal, $nepean, $toronto, $pei ), $terms ); 1178 1178 } 1179 1179 … … 1244 1244 ); 1245 1245 1246 $this->assert EqualSets( array( $laval ), $terms );1246 $this->assertSameSets( array( $laval ), $terms ); 1247 1247 } 1248 1248 … … 1278 1278 ); 1279 1279 1280 $this->assert EqualSets( array( $t2, $t4 ), $found );1280 $this->assertSameSets( array( $t2, $t4 ), $found ); 1281 1281 } 1282 1282 … … 1306 1306 _unregister_taxonomy( 'hierarchical_fields' ); 1307 1307 1308 $this->assert EqualSets( $expected, $found );1308 $this->assertSameSets( $expected, $found ); 1309 1309 } 1310 1310 … … 1332 1332 _unregister_taxonomy( 'hierarchical_fields' ); 1333 1333 1334 $this->assert EqualSets( $expected, $found );1334 $this->assertSameSets( $expected, $found ); 1335 1335 } 1336 1336 … … 1358 1358 _unregister_taxonomy( 'hierarchical_fields' ); 1359 1359 1360 $this->assert EqualSets( $expected, $found );1360 $this->assertSameSets( $expected, $found ); 1361 1361 } 1362 1362 … … 1386 1386 _unregister_taxonomy( 'hierarchical_fields' ); 1387 1387 1388 $this->assert EqualSets( $expected, $found );1388 $this->assertSameSets( $expected, $found ); 1389 1389 } 1390 1390 … … 1412 1412 _unregister_taxonomy( 'hierarchical_fields' ); 1413 1413 1414 $this->assert EqualSets( $expected, $found );1414 $this->assertSameSets( $expected, $found ); 1415 1415 } 1416 1416 … … 1438 1438 _unregister_taxonomy( 'hierarchical_fields' ); 1439 1439 1440 $this->assert EqualSets( $expected, $found );1440 $this->assertSameSets( $expected, $found ); 1441 1441 } 1442 1442 … … 1608 1608 _unregister_taxonomy( 'hierarchical_fields' ); 1609 1609 1610 $this->assert EqualSetsWithIndex( $expected, $found );1610 $this->assertSameSetsWithIndex( $expected, $found ); 1611 1611 } 1612 1612 … … 1637 1637 _unregister_taxonomy( 'hierarchical_fields' ); 1638 1638 1639 $this->assert EqualSetsWithIndex( $expected, $found );1639 $this->assertSameSetsWithIndex( $expected, $found ); 1640 1640 } 1641 1641 … … 1663 1663 _unregister_taxonomy( 'hierarchical_fields' ); 1664 1664 1665 $this->assert EqualSetsWithIndex( $expected, $found );1665 $this->assertSameSetsWithIndex( $expected, $found ); 1666 1666 } 1667 1667 … … 1691 1691 _unregister_taxonomy( 'hierarchical_fields' ); 1692 1692 1693 $this->assert EqualSetsWithIndex( $expected, $found );1693 $this->assertSameSetsWithIndex( $expected, $found ); 1694 1694 } 1695 1695 … … 1720 1720 _unregister_taxonomy( 'hierarchical_fields' ); 1721 1721 1722 $this->assert EqualSetsWithIndex( $expected, $found );1722 $this->assertSameSetsWithIndex( $expected, $found ); 1723 1723 } 1724 1724 … … 1746 1746 _unregister_taxonomy( 'hierarchical_fields' ); 1747 1747 1748 $this->assert EqualSetsWithIndex( $expected, $found );1748 $this->assertSameSetsWithIndex( $expected, $found ); 1749 1749 } 1750 1750 … … 1958 1958 ); 1959 1959 1960 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );1960 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 1961 1961 } 1962 1962 … … 1996 1996 ); 1997 1997 1998 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );1998 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 1999 1999 } 2000 2000 … … 2026 2026 ); 2027 2027 2028 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2028 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2029 2029 2030 2030 $found = get_terms( … … 2045 2045 ); 2046 2046 2047 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2047 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2048 2048 2049 2049 // Matches the first meta query clause. … … 2070 2070 ); 2071 2071 2072 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2072 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2073 2073 2074 2074 // Matches the meta query clause corresponding to the 'meta_key' param. … … 2095 2095 ); 2096 2096 2097 $this->assert EqualSets( array( $terms[1], $terms[0], $terms[2] ), $found );2097 $this->assertSameSets( array( $terms[1], $terms[0], $terms[2] ), $found ); 2098 2098 } 2099 2099 … … 2125 2125 ); 2126 2126 2127 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2127 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2128 2128 2129 2129 $found = get_terms( … … 2144 2144 ); 2145 2145 2146 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2146 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2147 2147 2148 2148 $found = get_terms( … … 2168 2168 ); 2169 2169 2170 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2170 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2171 2171 2172 2172 $found = get_terms( … … 2192 2192 ); 2193 2193 2194 $this->assert EqualSets( array( $terms[1], $terms[0], $terms[2] ), $found );2194 $this->assertSameSets( array( $terms[1], $terms[0], $terms[2] ), $found ); 2195 2195 } 2196 2196 … … 2229 2229 ); 2230 2230 2231 $this->assert EqualSets( array( $terms[1], $terms[2], $terms[0] ), $found );2231 $this->assertSameSets( array( $terms[1], $terms[2], $terms[0] ), $found ); 2232 2232 2233 2233 $found = get_terms( … … 2252 2252 ); 2253 2253 2254 $this->assert EqualSets( array( $terms[1], $terms[0], $terms[2] ), $found );2254 $this->assertSameSets( array( $terms[1], $terms[0], $terms[2] ), $found ); 2255 2255 2256 2256 $expected = get_terms( … … 2293 2293 ); 2294 2294 2295 $this->assert EqualSets( $expected, $found );2295 $this->assertSameSets( $expected, $found ); 2296 2296 } 2297 2297 … … 2333 2333 ); 2334 2334 $actual = wp_list_pluck( $terms, 'term_id' ); 2335 $this->assert EqualSets( $expected, $actual );2335 $this->assertSameSets( $expected, $actual ); 2336 2336 } 2337 2337 … … 2359 2359 2360 2360 $actual = wp_list_pluck( $terms, 'term_id' ); 2361 $this->assert EqualSets( $expected, $actual );2361 $this->assertSameSets( $expected, $actual ); 2362 2362 } 2363 2363 … … 2397 2397 ); 2398 2398 $actual = wp_list_pluck( $terms, 'term_id' ); 2399 $this->assert EqualSets( $expected, $actual );2399 $this->assertSameSets( $expected, $actual ); 2400 2400 } 2401 2401 … … 2419 2419 ); 2420 2420 $actual = wp_list_pluck( $terms, 'term_id' ); 2421 $this->assert EqualSets( $expected, $actual );2421 $this->assertSameSets( $expected, $actual ); 2422 2422 } 2423 2423 … … 2471 2471 ); 2472 2472 2473 $this->assert EqualSets( array( $t3 ), $found );2473 $this->assertSameSets( array( $t3 ), $found ); 2474 2474 } 2475 2475 … … 2513 2513 ); 2514 2514 $actual = wp_list_pluck( $terms, 'term_id' ); 2515 $this->assert EqualSets( $expected, $actual );2515 $this->assertSameSets( $expected, $actual ); 2516 2516 } 2517 2517 … … 2550 2550 ); 2551 2551 2552 $this->assert EqualSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) );2552 $this->assertSameSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) ); 2553 2553 2554 2554 foreach ( $found as $f ) { … … 2588 2588 ); 2589 2589 2590 $this->assert EqualSets( array( $c1, $c2, $c3 ), wp_list_pluck( $terms, 'term_id' ) );2590 $this->assertSameSets( array( $c1, $c2, $c3 ), wp_list_pluck( $terms, 'term_id' ) ); 2591 2591 2592 2592 foreach ( $terms as $term ) { … … 2623 2623 ); 2624 2624 2625 $this->assert EqualSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) );2625 $this->assertSameSets( array( $t1, $t2, $t3 ), wp_list_pluck( $found, 'term_id' ) ); 2626 2626 2627 2627 foreach ( $found as $f ) { … … 2720 2720 ); 2721 2721 2722 $this->assert EqualSets( array( $terms[0], $terms[1] ), $found );2722 $this->assertSameSets( array( $terms[0], $terms[1] ), $found ); 2723 2723 } 2724 2724 … … 2747 2747 ); 2748 2748 2749 $this->assert EqualSets( array( $terms[0] ), $found );2749 $this->assertSameSets( array( $terms[0] ), $found ); 2750 2750 } 2751 2751 … … 2872 2872 ) 2873 2873 ); 2874 $this->assert EqualSets( $terms, $found );2874 $this->assertSameSets( $terms, $found ); 2875 2875 } 2876 2876 … … 2894 2894 ) 2895 2895 ); 2896 $this->assert EqualSets( array( $terms[1] ), $found );2896 $this->assertSameSets( array( $terms[1] ), $found ); 2897 2897 } 2898 2898 … … 2916 2916 ) 2917 2917 ); 2918 $this->assert EqualSets( array( $terms[1] ), $found );2918 $this->assertSameSets( array( $terms[1] ), $found ); 2919 2919 } 2920 2920 … … 2938 2938 ) 2939 2939 ); 2940 $this->assert EqualSets( array(), $found );2940 $this->assertSameSets( array(), $found ); 2941 2941 } 2942 2942 … … 2986 2986 ); 2987 2987 2988 $this->assert EqualSets( array( $term_id ), wp_list_pluck( $found, 'term_id' ) );2988 $this->assertSameSets( array( $term_id ), wp_list_pluck( $found, 'term_id' ) ); 2989 2989 } 2990 2990 … … 3022 3022 ); 3023 3023 3024 $this->assert EqualSets( array( $term_id1, $term_id2 ), wp_list_pluck( $found, 'term_id' ) );3024 $this->assertSameSets( array( $term_id1, $term_id2 ), wp_list_pluck( $found, 'term_id' ) ); 3025 3025 } 3026 3026
Note: See TracChangeset
for help on using the changeset viewer.