Changeset 48939 for trunk/tests/phpunit/tests/query/metaQuery.php
- Timestamp:
- 09/04/2020 07:01:00 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/metaQuery.php
r48937 r48939 29 29 30 30 $expected = array( $p1, $p2 ); 31 $this->assert EqualSets( $expected, $query->posts );31 $this->assertSameSets( $expected, $query->posts ); 32 32 } 33 33 … … 55 55 56 56 $expected = array( $p2, $p3 ); 57 $this->assert EqualSets( $expected, $query->posts );57 $this->assertSameSets( $expected, $query->posts ); 58 58 } 59 59 … … 79 79 80 80 $expected = array( $p1 ); 81 $this->assert EqualSets( $expected, $query->posts );81 $this->assertSameSets( $expected, $query->posts ); 82 82 } 83 83 … … 104 104 105 105 $expected = array( $p1 ); 106 $this->assert EqualSets( $expected, $query->posts );106 $this->assertSameSets( $expected, $query->posts ); 107 107 } 108 108 … … 131 131 132 132 $expected = array( $p2 ); 133 $this->assert EqualSets( $expected, $query->posts );133 $this->assertSameSets( $expected, $query->posts ); 134 134 } 135 135 … … 160 160 161 161 $expected = array( $p1 ); 162 $this->assert EqualSets( $expected, $query->posts );162 $this->assertSameSets( $expected, $query->posts ); 163 163 164 164 // <= … … 179 179 180 180 $expected = array( $p1, $p2 ); 181 $this->assert EqualSets( $expected, $query->posts );181 $this->assertSameSets( $expected, $query->posts ); 182 182 183 183 // >= … … 198 198 199 199 $expected = array( $p2, $p3 ); 200 $this->assert EqualSets( $expected, $query->posts );200 $this->assertSameSets( $expected, $query->posts ); 201 201 202 202 // > … … 217 217 218 218 $expected = array( $p3 ); 219 $this->assert EqualSets( $expected, $query->posts );219 $this->assertSameSets( $expected, $query->posts ); 220 220 } 221 221 … … 242 242 243 243 $expected = array( $p1 ); 244 $this->assert EqualSets( $expected, $query->posts );244 $this->assertSameSets( $expected, $query->posts ); 245 245 } 246 246 … … 269 269 270 270 $expected = array( $p2 ); 271 $this->assert EqualSets( $expected, $query->posts );271 $this->assertSameSets( $expected, $query->posts ); 272 272 } 273 273 … … 298 298 299 299 $expected = array( $p2 ); 300 $this->assert EqualSets( $expected, $query->posts );300 $this->assertSameSets( $expected, $query->posts ); 301 301 302 302 $query = new WP_Query( … … 317 317 318 318 $expected = array( $p1, $p3 ); 319 $this->assert EqualSets( $expected, $query->posts );319 $this->assertSameSets( $expected, $query->posts ); 320 320 } 321 321 … … 343 343 344 344 $expected = array( $p2 ); 345 $this->assert EqualSets( $expected, $query->posts );345 $this->assertSameSets( $expected, $query->posts ); 346 346 347 347 // RLIKE is a synonym for REGEXP. … … 362 362 363 363 $expected = array( $p2 ); 364 $this->assert EqualSets( $expected, $query->posts );364 $this->assertSameSets( $expected, $query->posts ); 365 365 } 366 366 … … 388 388 389 389 $expected = array( $p1 ); 390 $this->assert EqualSets( $expected, $query->posts );390 $this->assertSameSets( $expected, $query->posts ); 391 391 } 392 392 … … 468 468 469 469 $expected = array( $post_id, $post_id2, $post_id3, $post_id4 ); 470 $this->assert EqualSets( $expected, $query->posts );470 $this->assertSameSets( $expected, $query->posts ); 471 471 } 472 472 … … 524 524 525 525 $expected = array( $post_id7 ); 526 $this->assert EqualSets( $expected, $query->posts );526 $this->assertSameSets( $expected, $query->posts ); 527 527 528 528 $query = new WP_Query( … … 544 544 545 545 $expected = array( $post_id2, $post_id6, $post_id7 ); 546 $this->assert EqualSets( $expected, $query->posts );546 $this->assertSameSets( $expected, $query->posts ); 547 547 } 548 548 … … 567 567 ); 568 568 569 $this->assert EqualSets( array( $posts[0], $posts[2] ), $query->posts );569 $this->assertSameSets( array( $posts[0], $posts[2] ), $query->posts ); 570 570 } 571 571 … … 591 591 ); 592 592 593 $this->assert EqualSets( array( $posts[2] ), $query->posts );593 $this->assertSameSets( array( $posts[2] ), $query->posts ); 594 594 } 595 595 … … 615 615 ); 616 616 617 $this->assert EqualSets( array( $posts[1] ), $query->posts );617 $this->assertSameSets( array( $posts[1] ), $query->posts ); 618 618 } 619 619 … … 652 652 653 653 $expected = array( $post_id2, $post_id3, $post_id4 ); 654 $this->assert EqualSets( $expected, $query->posts );654 $this->assertSameSets( $expected, $query->posts ); 655 655 656 656 $query = new WP_Query( … … 735 735 736 736 $expected = array( $posts[1], $posts[2], $posts[3] ); 737 $this->assert EqualSets( $expected, $query->posts );737 $this->assertSameSets( $expected, $query->posts ); 738 738 } 739 739 … … 770 770 771 771 $expected = array( $posts[1], $posts[2] ); 772 $this->assert EqualSets( $expected, $query->posts );772 $this->assertSameSets( $expected, $query->posts ); 773 773 } 774 774 … … 805 805 806 806 $expected = array( $posts[0], $posts[1] ); 807 $this->assert EqualSets( $expected, $query->posts );807 $this->assertSameSets( $expected, $query->posts ); 808 808 } 809 809 … … 840 840 841 841 $expected = array( $posts[0], $posts[1] ); 842 $this->assert EqualSets( $expected, $query->posts );842 $this->assertSameSets( $expected, $query->posts ); 843 843 } 844 844 … … 875 875 876 876 $expected = array( $posts[1], $posts[2] ); 877 $this->assert EqualSets( $expected, $query->posts );877 $this->assertSameSets( $expected, $query->posts ); 878 878 } 879 879 … … 911 911 912 912 $expected = array( $posts[0], $posts[2] ); 913 $this->assert EqualSets( $expected, $query->posts );913 $this->assertSameSets( $expected, $query->posts ); 914 914 } 915 915 … … 948 948 949 949 $expected = array( $posts[3] ); 950 $this->assert EqualSets( $expected, $query->posts );950 $this->assertSameSets( $expected, $query->posts ); 951 951 } 952 952 … … 985 985 986 986 $expected = array( $posts[1] ); 987 $this->assert EqualSets( $expected, $query->posts );987 $this->assertSameSets( $expected, $query->posts ); 988 988 } 989 989 … … 1021 1021 1022 1022 $expected = array( $posts[3] ); 1023 $this->assert EqualSets( $expected, $query->posts );1023 $this->assertSameSets( $expected, $query->posts ); 1024 1024 } 1025 1025 … … 1064 1064 1065 1065 $expected = array( $posts[2] ); 1066 $this->assert EqualSets( $expected, $query->posts );1066 $this->assertSameSets( $expected, $query->posts ); 1067 1067 } 1068 1068 … … 1100 1100 1101 1101 $expected = array( $posts[3] ); 1102 $this->assert EqualSets( $expected, $query->posts );1102 $this->assertSameSets( $expected, $query->posts ); 1103 1103 } 1104 1104 … … 1136 1136 1137 1137 $expected = array( $posts[3] ); 1138 $this->assert EqualSets( $expected, $query->posts );1138 $this->assertSameSets( $expected, $query->posts ); 1139 1139 } 1140 1140 … … 1168 1168 ) 1169 1169 ); 1170 $this->assert EqualSets( array( $post_3 ), $query->posts );1170 $this->assertSameSets( array( $post_3 ), $query->posts ); 1171 1171 1172 1172 $query = new WP_Query( … … 1185 1185 ) 1186 1186 ); 1187 $this->assert EqualSets( array( $post_4 ), $query->posts );1187 $this->assertSameSets( array( $post_4 ), $query->posts ); 1188 1188 1189 1189 $query = new WP_Query( … … 1202 1202 ) 1203 1203 ); 1204 $this->assert EqualSets( array( $post_3, $post_4 ), $query->posts );1204 $this->assertSameSets( array( $post_3, $post_4 ), $query->posts ); 1205 1205 1206 1206 $query = new WP_Query( … … 1219 1219 ) 1220 1220 ); 1221 $this->assert EqualSets( array( $post_1 ), $query->posts, 'ID' );1221 $this->assertSameSets( array( $post_1 ), $query->posts, 'ID' ); 1222 1222 1223 1223 $query = new WP_Query( … … 1236 1236 ) 1237 1237 ); 1238 $this->assert EqualSets( array( $post_1, $post_2, $post_3 ), $query->posts );1238 $this->assertSameSets( array( $post_1, $post_2, $post_3 ), $query->posts ); 1239 1239 1240 1240 $query = new WP_Query( … … 1253 1253 ) 1254 1254 ); 1255 $this->assert EqualSets( array( $post_3 ), $query->posts );1255 $this->assertSameSets( array( $post_3 ), $query->posts ); 1256 1256 1257 1257 $query = new WP_Query( … … 1270 1270 ) 1271 1271 ); 1272 $this->assert EqualSets( array( $post_1, $post_2, $post_4 ), $query->posts );1272 $this->assertSameSets( array( $post_1, $post_2, $post_4 ), $query->posts ); 1273 1273 1274 1274 $query = new WP_Query( … … 1287 1287 ) 1288 1288 ); 1289 $this->assert EqualSets( array( $post_1, $post_3 ), $query->posts );1289 $this->assertSameSets( array( $post_1, $post_3 ), $query->posts ); 1290 1290 1291 1291 $query = new WP_Query( … … 1304 1304 ) 1305 1305 ); 1306 $this->assert EqualSets( array( $post_2, $post_4 ), $query->posts );1306 $this->assertSameSets( array( $post_2, $post_4 ), $query->posts ); 1307 1307 1308 1308 $query = new WP_Query( … … 1317 1317 ) 1318 1318 ); 1319 $this->assert EqualSets( array( $post_4, $post_3, $post_2, $post_1 ), $query->posts );1319 $this->assertSameSets( array( $post_4, $post_3, $post_2, $post_1 ), $query->posts ); 1320 1320 } 1321 1321 … … 1462 1462 1463 1463 $expected = array( $p1, $p3 ); 1464 $this->assert EqualSets( $expected, $query->posts );1464 $this->assertSameSets( $expected, $query->posts ); 1465 1465 } 1466 1466 … … 1512 1512 1513 1513 $expected = array( $p1, $p3 ); 1514 $this->assert EqualSets( $expected, $query->posts );1514 $this->assertSameSets( $expected, $query->posts ); 1515 1515 } 1516 1516 … … 1541 1541 } 1542 1542 $posts = wp_list_pluck( $query->posts, 'ID' ); 1543 $this->assert EqualSets( array( $post_id2, $post_id3 ), $posts );1543 $this->assertSameSets( array( $post_id2, $post_id3 ), $posts ); 1544 1544 1545 1545 $args = array( … … 1557 1557 } 1558 1558 $posts = wp_list_pluck( $query->posts, 'ID' ); 1559 $this->assert EqualSets( array( $post_id, $post_id4, $post_id5 ), $posts );1559 $this->assertSameSets( array( $post_id, $post_id4, $post_id5 ), $posts ); 1560 1560 } 1561 1561 … … 1585 1585 $this->assertSame( 2, count( $posts ) ); 1586 1586 $posts = wp_list_pluck( $posts, 'ID' ); 1587 $this->assert EqualSets( array( $post_id, $post_id3 ), $posts );1587 $this->assertSameSets( array( $post_id, $post_id3 ), $posts ); 1588 1588 1589 1589 $posts = get_posts( … … 1601 1601 } 1602 1602 $posts = wp_list_pluck( $posts, 'ID' ); 1603 $this->assert EqualSets( array( $post_id, $post_id3 ), $posts );1603 $this->assertSameSets( array( $post_id, $post_id3 ), $posts ); 1604 1604 } 1605 1605 … … 1632 1632 } 1633 1633 $posts = wp_list_pluck( $posts, 'ID' ); 1634 $this->assert EqualSets( array( $post_id, $post_id2 ), $posts );1634 $this->assertSameSets( array( $post_id, $post_id2 ), $posts ); 1635 1635 } 1636 1636 … … 1679 1679 } 1680 1680 $posts = wp_list_pluck( $posts, 'ID' ); 1681 $this->assert EqualSets( array( $post_id, $post_id5 ), $posts );1681 $this->assertSameSets( array( $post_id, $post_id5 ), $posts ); 1682 1682 1683 1683 $posts = get_posts( … … 1693 1693 } 1694 1694 $posts = wp_list_pluck( $posts, 'ID' ); 1695 $this->assert EqualSets( array( $post_id, $post_id5 ), $posts );1695 $this->assertSameSets( array( $post_id, $post_id5 ), $posts ); 1696 1696 1697 1697 $posts = get_posts( array( 'meta_value' => 0 ) ); … … 1702 1702 } 1703 1703 $posts = wp_list_pluck( $posts, 'ID' ); 1704 $this->assert EqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts );1704 $this->assertSameSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts ); 1705 1705 1706 1706 $posts = get_posts( array( 'meta_value' => '0' ) ); … … 1711 1711 } 1712 1712 $posts = wp_list_pluck( $posts, 'ID' ); 1713 $this->assert EqualSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts );1713 $this->assertSameSets( array( $post_id, $post_id3, $post_id4, $post_id5, $post_id6 ), $posts ); 1714 1714 } 1715 1715 … … 1847 1847 ); 1848 1848 1849 $this->assert EqualSets( array( 'foo_key', 'foo_key-1', 'foo_key-2' ), array_keys( $q->meta_query->get_clauses() ) );1849 $this->assertSameSets( array( 'foo_key', 'foo_key-1', 'foo_key-2' ), array_keys( $q->meta_query->get_clauses() ) ); 1850 1850 } 1851 1851 … … 1872 1872 ); 1873 1873 1874 $this->assert EqualSets( array( $posts[0], $posts[2] ), $q->posts );1874 $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); 1875 1875 } 1876 1876 … … 1893 1893 ); 1894 1894 1895 $this->assert EqualSets( array( $posts[0], $posts[2] ), $q->posts );1895 $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); 1896 1896 } 1897 1897 … … 1920 1920 ); 1921 1921 1922 $this->assert EqualSets( array( $posts[0] ), $q->posts );1922 $this->assertSameSets( array( $posts[0] ), $q->posts ); 1923 1923 1924 1924 } … … 1948 1948 ); 1949 1949 1950 $this->assert EqualSets( array( $posts[0], $posts[1] ), $q->posts );1950 $this->assertSameSets( array( $posts[0], $posts[1] ), $q->posts ); 1951 1951 } 1952 1952 … … 1975 1975 ); 1976 1976 1977 $this->assert EqualSets( array( $posts[0], $posts[2] ), $q->posts );1977 $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); 1978 1978 } 1979 1979 … … 2000 2000 ); 2001 2001 2002 $this->assert EqualSets( array( $posts[1], $posts[2] ), $q->posts );2002 $this->assertSameSets( array( $posts[1], $posts[2] ), $q->posts ); 2003 2003 } 2004 2004 … … 2027 2027 ); 2028 2028 2029 $this->assert EqualSets( array( $posts[1] ), $q->posts );2029 $this->assertSameSets( array( $posts[1] ), $q->posts ); 2030 2030 } 2031 2031 … … 2054 2054 ); 2055 2055 2056 $this->assert EqualSets( array( $posts[0], $posts[1] ), $q->posts );2056 $this->assertSameSets( array( $posts[0], $posts[1] ), $q->posts ); 2057 2057 } 2058 2058 … … 2081 2081 ); 2082 2082 2083 $this->assert EqualSets( array( $posts[2] ), $q->posts );2083 $this->assertSameSets( array( $posts[2] ), $q->posts ); 2084 2084 } 2085 2085 … … 2107 2107 ); 2108 2108 2109 $this->assert EqualSets( array( $posts[0], $posts[2] ), $q->posts );2109 $this->assertSameSets( array( $posts[0], $posts[2] ), $q->posts ); 2110 2110 2111 2111 $q = new WP_Query( … … 2122 2122 ); 2123 2123 2124 $this->assert EqualSets( array( $posts[0] ), $q->posts );2124 $this->assertSameSets( array( $posts[0] ), $q->posts ); 2125 2125 } 2126 2126 … … 2149 2149 ); 2150 2150 2151 $this->assert EqualSets( array( $posts[1] ), $q->posts );2151 $this->assertSameSets( array( $posts[1] ), $q->posts ); 2152 2152 2153 2153 $q = new WP_Query( … … 2164 2164 ); 2165 2165 2166 $this->assert EqualSets( array( $posts[1], $posts[2] ), $q->posts );2166 $this->assertSameSets( array( $posts[1], $posts[2] ), $q->posts ); 2167 2167 } 2168 2168 }
Note: See TracChangeset
for help on using the changeset viewer.