Changeset 48939 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 09/04/2020 07:01:00 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r48937 r48939 61 61 ); 62 62 63 $this->assert EqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found );63 $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); 64 64 } 65 65 … … 80 80 ); 81 81 82 $this->assert EqualSets( array( $c1 ), $found );82 $this->assertSameSets( array( $c1 ), $found ); 83 83 } 84 84 … … 130 130 ); 131 131 132 $this->assert EqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found );132 $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); 133 133 } 134 134 … … 180 180 ); 181 181 182 $this->assert EqualSets( array( $c1 ), $found );182 $this->assertSameSets( array( $c1 ), $found ); 183 183 } 184 184 … … 220 220 ); 221 221 222 $this->assert EqualSets( array( $c2, $c3 ), $found );222 $this->assertSameSets( array( $c2, $c3 ), $found ); 223 223 224 224 } … … 261 261 ); 262 262 263 $this->assert EqualSets( array( $c2, $c3 ), $found );263 $this->assertSameSets( array( $c2, $c3 ), $found ); 264 264 265 265 } … … 312 312 ); 313 313 314 $this->assert EqualSets( array( $c2, $c3 ), $found );314 $this->assertSameSets( array( $c2, $c3 ), $found ); 315 315 } 316 316 … … 371 371 ); 372 372 373 $this->assert EqualSets( array( $c1, $c4, $c6 ), $found );373 $this->assertSameSets( array( $c1, $c4, $c6 ), $found ); 374 374 } 375 375 … … 428 428 ); 429 429 430 $this->assert EqualSets( array( $c1, $c2, $c3, $c4, $c6 ), $found );430 $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c6 ), $found ); 431 431 } 432 432 … … 486 486 ); 487 487 488 $this->assert EqualSets( array( $c1 ), $found );488 $this->assertSameSets( array( $c1 ), $found ); 489 489 } 490 490 … … 544 544 ); 545 545 546 $this->assert EqualSets( array( $c2, $c3 ), $found );546 $this->assertSameSets( array( $c2, $c3 ), $found ); 547 547 } 548 548 … … 601 601 ); 602 602 603 $this->assert EqualSets( array( $c1, $c2, $c3, $c4, $c6 ), $found );603 $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c6 ), $found ); 604 604 } 605 605 … … 651 651 ); 652 652 653 $this->assert EqualSets( array( $c1, $c2, $c3 ), $found );653 $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); 654 654 } 655 655 … … 687 687 ); 688 688 689 $this->assert EqualSets( array( $c1, $c2, $c3 ), $found );689 $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); 690 690 } 691 691 … … 795 795 ); 796 796 797 $this->assert EqualSets( array( $c2, $c3 ), $found );797 $this->assertSameSets( array( $c2, $c3 ), $found ); 798 798 } 799 799 … … 839 839 ); 840 840 841 $this->assert EqualSets( array( $c3, $c2 ), $found );841 $this->assertSameSets( array( $c3, $c2 ), $found ); 842 842 } 843 843 … … 955 955 ); 956 956 957 $this->assert EqualSets( array( $c3, $c2 ), $found );957 $this->assertSameSets( array( $c3, $c2 ), $found ); 958 958 } 959 959 … … 989 989 ); 990 990 991 $this->assert EqualSets( array( $c1, $c2 ), $found );991 $this->assertSameSets( array( $c1, $c2 ), $found ); 992 992 } 993 993 … … 1107 1107 ); 1108 1108 1109 $this->assert EqualSets( array( $c1, $c3 ), $found );1109 $this->assertSameSets( array( $c1, $c3 ), $found ); 1110 1110 } 1111 1111 … … 1137 1137 ); 1138 1138 1139 $this->assert EqualSets( array( $c1, $c3 ), $found );1139 $this->assertSameSets( array( $c1, $c3 ), $found ); 1140 1140 } 1141 1141 … … 1171 1171 ); 1172 1172 1173 $this->assert EqualSets( array( $c1, $c2, $c3 ), $found );1173 $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); 1174 1174 } 1175 1175 … … 1205 1205 ); 1206 1206 1207 $this->assert EqualSets( array( $c1, $c2 ), $found );1207 $this->assertSameSets( array( $c1, $c2 ), $found ); 1208 1208 } 1209 1209 … … 1239 1239 ); 1240 1240 1241 $this->assert EqualSets( array( $c1, $c2 ), $found );1241 $this->assertSameSets( array( $c1, $c2 ), $found ); 1242 1242 } 1243 1243 … … 1688 1688 ); 1689 1689 1690 $this->assert EqualSets( array( $c1, $c2 ), $comments );1690 $this->assertSameSets( array( $c1, $c2 ), $comments ); 1691 1691 } 1692 1692 … … 1724 1724 $comment_ids = get_comments( array( 'fields' => 'ids' ) ); 1725 1725 $this->assertCount( 3, $comment_ids ); 1726 $this->assert EqualSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids );1726 $this->assertSameSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids ); 1727 1727 } 1728 1728 … … 1760 1760 ); 1761 1761 1762 $this->assert EqualSets( array( $comment_1, $comment_3 ), $comment_ids );1762 $this->assertSameSets( array( $comment_1, $comment_3 ), $comment_ids ); 1763 1763 } 1764 1764 … … 1796 1796 ); 1797 1797 1798 $this->assert EqualSets( array( $comment_1 ), $comment_ids );1798 $this->assertSameSets( array( $comment_1 ), $comment_ids ); 1799 1799 } 1800 1800 … … 1836 1836 ); 1837 1837 1838 $this->assert EqualSets( array( $c1, $c2 ), $comment_ids );1838 $this->assertSameSets( array( $c1, $c2 ), $comment_ids ); 1839 1839 } 1840 1840 … … 1876 1876 ); 1877 1877 1878 $this->assert EqualSets( array( $c3 ), $comment_ids );1878 $this->assertSameSets( array( $c3 ), $comment_ids ); 1879 1879 } 1880 1880 … … 1919 1919 ); 1920 1920 1921 $this->assert EqualSets( array( $c1, $c2 ), $comment_ids );1921 $this->assertSameSets( array( $c1, $c2 ), $comment_ids ); 1922 1922 } 1923 1923 … … 1962 1962 ); 1963 1963 1964 $this->assert EqualSets( array( $c3 ), $comment_ids );1964 $this->assertSameSets( array( $c3 ), $comment_ids ); 1965 1965 } 1966 1966 … … 2010 2010 ); 2011 2011 2012 $this->assert EqualSets( array( $c1, $c3 ), $comment_ids );2012 $this->assertSameSets( array( $c1, $c3 ), $comment_ids ); 2013 2013 } 2014 2014 … … 2058 2058 ); 2059 2059 2060 $this->assert EqualSets( array( $c3, $c4 ), $comment_ids );2060 $this->assertSameSets( array( $c3, $c4 ), $comment_ids ); 2061 2061 } 2062 2062 … … 2089 2089 2090 2090 $comment_ids = get_comments( array( 'fields' => 'ids' ) ); 2091 $this->assert EqualSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids );2091 $this->assertSameSets( array( $comment_1, $comment_2, $comment_3 ), $comment_ids ); 2092 2092 } 2093 2093 … … 2133 2133 ); 2134 2134 2135 $this->assert EqualSets( array( $c1, $c2, $c3 ), $found );2135 $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); 2136 2136 } 2137 2137 … … 2184 2184 ); 2185 2185 2186 $this->assert EqualSets( array( $c1, $c2, $c3, $c5 ), $found );2186 $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); 2187 2187 } 2188 2188 … … 2235 2235 ); 2236 2236 2237 $this->assert EqualSets( array( $c1, $c2, $c3, $c5 ), $found );2237 $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); 2238 2238 } 2239 2239 … … 2285 2285 ); 2286 2286 2287 $this->assert EqualSets( array( $c1, $c2, $c3 ), $found );2287 $this->assertSameSets( array( $c1, $c2, $c3 ), $found ); 2288 2288 } 2289 2289 … … 2344 2344 ); 2345 2345 2346 $this->assert EqualSets( array( $c1, $c2, $c3, $c5 ), $found );2346 $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); 2347 2347 } 2348 2348 … … 2403 2403 ); 2404 2404 2405 $this->assert EqualSets( array( $c1, $c2, $c3, $c5 ), $found );2405 $this->assertSameSets( array( $c1, $c2, $c3, $c5 ), $found ); 2406 2406 } 2407 2407 … … 2476 2476 ); 2477 2477 2478 $this->assert EqualSets( array( $c1, $c2, $c3, $c4, $c5 ), $found );2478 $this->assertSameSets( array( $c1, $c2, $c3, $c4, $c5 ), $found ); 2479 2479 } 2480 2480 … … 3056 3056 ); 3057 3057 3058 $this->assert EqualSets( $c2, $found );3058 $this->assertSameSets( $c2, $found ); 3059 3059 3060 3060 _unregister_post_type( 'post-type-1' ); … … 3083 3083 ); 3084 3084 3085 $this->assert EqualSets( $c2, $found );3085 $this->assertSameSets( $c2, $found ); 3086 3086 3087 3087 _unregister_post_type( 'post-type-1' ); … … 3113 3113 ); 3114 3114 3115 $this->assert EqualSets( array_merge( $c1, $c3 ), $found );3115 $this->assertSameSets( array_merge( $c1, $c3 ), $found ); 3116 3116 } 3117 3117 … … 3131 3131 ); 3132 3132 3133 $this->assert EqualSets( $c2, $found );3133 $this->assertSameSets( $c2, $found ); 3134 3134 } 3135 3135 … … 3152 3152 ); 3153 3153 3154 $this->assert EqualSets( $c2, $found );3154 $this->assertSameSets( $c2, $found ); 3155 3155 } 3156 3156 … … 3175 3175 ); 3176 3176 3177 $this->assert EqualSets( array_merge( $c1, $c3 ), $found );3177 $this->assertSameSets( array_merge( $c1, $c3 ), $found ); 3178 3178 } 3179 3179 … … 3193 3193 ); 3194 3194 3195 $this->assert EqualSets( $c2, $found );3195 $this->assertSameSets( $c2, $found ); 3196 3196 } 3197 3197 … … 3214 3214 ); 3215 3215 3216 $this->assert EqualSets( $c2, $found );3216 $this->assertSameSets( $c2, $found ); 3217 3217 } 3218 3218 … … 3237 3237 ); 3238 3238 3239 $this->assert EqualSets( array_merge( $c1, $c3 ), $found );3239 $this->assertSameSets( array_merge( $c1, $c3 ), $found ); 3240 3240 } 3241 3241 … … 3260 3260 ) 3261 3261 ); 3262 $this->assert EqualSets( array_merge( $c1, $c2 ), $found );3262 $this->assertSameSets( array_merge( $c1, $c2 ), $found ); 3263 3263 } 3264 3264 … … 3283 3283 ) 3284 3284 ); 3285 $this->assert EqualSets( array_merge( $c1, $c2 ), $found );3285 $this->assertSameSets( array_merge( $c1, $c2 ), $found ); 3286 3286 } 3287 3287 … … 3303 3303 ) 3304 3304 ); 3305 $this->assert EqualSets( array_merge( $c1, $c2 ), $found );3305 $this->assertSameSets( array_merge( $c1, $c2 ), $found ); 3306 3306 } 3307 3307 … … 3323 3323 ) 3324 3324 ); 3325 $this->assert EqualSets( array_merge( $c1, $c2 ), $found );3325 $this->assertSameSets( array_merge( $c1, $c2 ), $found ); 3326 3326 } 3327 3327 … … 3447 3447 remove_action( 'pre_get_comments', array( $this, 'modify_meta_query' ) ); 3448 3448 3449 $this->assert EqualSets( array( $comments[1] ), $q->comments );3449 $this->assertSameSets( array( $comments[1] ), $q->comments ); 3450 3450 } 3451 3451 … … 3485 3485 remove_action( 'pre_get_comments', array( $this, 'modify_meta_params' ) ); 3486 3486 3487 $this->assert EqualSets( array( $comments[1] ), $q->comments );3487 $this->assertSameSets( array( $comments[1] ), $q->comments ); 3488 3488 } 3489 3489 … … 3519 3519 ); 3520 3520 3521 $this->assert EqualSets( array( $c2 ), $ids->comments );3521 $this->assertSameSets( array( $c2 ), $ids->comments ); 3522 3522 } 3523 3523 … … 3561 3561 ); 3562 3562 3563 $this->assert EqualSets( array( $c3, $c4 ), $ids->comments );3563 $this->assertSameSets( array( $c3, $c4 ), $ids->comments ); 3564 3564 } 3565 3565 … … 3591 3591 ); 3592 3592 3593 $this->assert EqualSets( array( $c1 ), $ids->comments );3593 $this->assertSameSets( array( $c1 ), $ids->comments ); 3594 3594 } 3595 3595 … … 3634 3634 ); 3635 3635 3636 $this->assert EqualSets( array( $c1, $c2 ), $ids->comments );3636 $this->assertSameSets( array( $c1, $c2 ), $ids->comments ); 3637 3637 } 3638 3638 … … 4162 4162 $q2_ids = wp_list_pluck( $q2->comments, 'comment_ID' ); 4163 4163 4164 $this->assert EqualSets( $q1_ids, $q2_ids );4164 $this->assertSameSets( $q1_ids, $q2_ids ); 4165 4165 $this->assertSame( $num_queries, $wpdb->num_queries ); 4166 4166 } … … 4224 4224 ); 4225 4225 $q2_ids = wp_list_pluck( $q2->comments, 'comment_ID' ); 4226 $this->assert EqualSets( $q1_ids, $q2_ids );4226 $this->assertSameSets( $q1_ids, $q2_ids ); 4227 4227 } 4228 4228 … … 4288 4288 $found_1 = $found[ $c1 ]; 4289 4289 $children_1 = $found_1->get_children(); 4290 $this->assert EqualSets( array( $c2 ), array_keys( $children_1 ) );4290 $this->assertSameSets( array( $c2 ), array_keys( $children_1 ) ); 4291 4291 4292 4292 $found_3 = $found[ $c3 ]; 4293 4293 $children_3 = $found_3->get_children(); 4294 $this->assert EqualSets( array( $c4, $c5 ), array_keys( $children_3 ) );4294 $this->assertSameSets( array( $c4, $c5 ), array_keys( $children_3 ) ); 4295 4295 } 4296 4296 … … 4442 4442 4443 4443 $this->assertSame( $num_queries, $wpdb->num_queries ); 4444 $this->assert EqualSets( array( $c ), $q->comments );4444 $this->assertSameSets( array( $c ), $q->comments ); 4445 4445 } 4446 4446 … … 4482 4482 $num_queries++; 4483 4483 $this->assertSame( $num_queries, $wpdb->num_queries ); 4484 $this->assert EqualSets( array( $c ), $q->comments );4484 $this->assertSameSets( array( $c ), $q->comments ); 4485 4485 } 4486 4486 … … 4515 4515 $num_queries++; 4516 4516 $this->assertSame( $num_queries, $wpdb->num_queries ); 4517 $this->assert EqualSets( array(), $q->comments );4517 $this->assertSameSets( array(), $q->comments ); 4518 4518 } 4519 4519 … … 4548 4548 $num_queries++; 4549 4549 $this->assertSame( $num_queries, $wpdb->num_queries ); 4550 $this->assert EqualSets( array(), $q->comments );4550 $this->assertSameSets( array(), $q->comments ); 4551 4551 } 4552 4552 … … 4583 4583 $num_queries++; 4584 4584 $this->assertSame( $num_queries, $wpdb->num_queries ); 4585 $this->assert EqualSets( array( $c ), $q->comments );4585 $this->assertSameSets( array( $c ), $q->comments ); 4586 4586 } 4587 4587 … … 4616 4616 $num_queries++; 4617 4617 $this->assertSame( $num_queries, $wpdb->num_queries ); 4618 $this->assert EqualSets( array(), $q->comments );4618 $this->assertSameSets( array(), $q->comments ); 4619 4619 } 4620 4620 … … 4651 4651 $num_queries++; 4652 4652 $this->assertSame( $num_queries, $wpdb->num_queries ); 4653 $this->assert EqualSets( array( $c ), $q->comments );4653 $this->assertSameSets( array( $c ), $q->comments ); 4654 4654 } 4655 4655 … … 4767 4767 ); 4768 4768 4769 $this->assert EqualSets( $c1, $cached );4769 $this->assertSameSets( $c1, $cached ); 4770 4770 4771 4771 foreach ( $c2 as $cid ) { … … 4786 4786 ); 4787 4787 4788 $this->assert EqualSets( array_merge( $c1, $c2 ), $found );4788 $this->assertSameSets( array_merge( $c1, $c2 ), $found ); 4789 4789 } 4790 4790 … … 4816 4816 ); 4817 4817 4818 $this->assert EqualSets( array_merge( $c1, $c2 ), $cached );4818 $this->assertSameSets( array_merge( $c1, $c2 ), $cached ); 4819 4819 4820 4820 foreach ( $c2 as $cid ) { … … 4835 4835 ); 4836 4836 4837 $this->assert EqualSets( $c1, $found );4837 $this->assertSameSets( $c1, $found ); 4838 4838 } 4839 4839 … … 4865 4865 ); 4866 4866 4867 $this->assert EqualSets( array_merge( $c1, $c2 ), $cached );4867 $this->assertSameSets( array_merge( $c1, $c2 ), $cached ); 4868 4868 4869 4869 foreach ( $c2 as $cid ) { … … 4884 4884 ); 4885 4885 4886 $this->assert EqualSets( $c1, $found );4886 $this->assertSameSets( $c1, $found ); 4887 4887 } 4888 4888
Note: See TracChangeset
for help on using the changeset viewer.