Changeset 52010 for trunk/tests/phpunit/tests/query/results.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/results.php
r51568 r52010 295 295 } 296 296 297 function set_up() {297 public function set_up() { 298 298 parent::set_up(); 299 299 … … 302 302 } 303 303 304 function test_query_default() {304 public function test_query_default() { 305 305 $posts = $this->q->query( '' ); 306 306 … … 322 322 } 323 323 324 function test_query_tag_a() {324 public function test_query_tag_a() { 325 325 $posts = $this->q->query( 'tag=tag-a' ); 326 326 … … 333 333 } 334 334 335 function test_query_tag_b() {335 public function test_query_tag_b() { 336 336 $posts = $this->q->query( 'tag=tag-b' ); 337 337 … … 347 347 * @ticket 21779 348 348 */ 349 function test_query_tag_nun() {349 public function test_query_tag_nun() { 350 350 $posts = $this->q->query( 'tag=tag-נ' ); 351 351 … … 355 355 } 356 356 357 function test_query_tag_id() {357 public function test_query_tag_id() { 358 358 $tag = tag_exists( 'tag-a' ); 359 359 $posts = $this->q->query( 'tag_id=' . $tag['term_id'] ); … … 367 367 } 368 368 369 function test_query_tag_slug__in() {369 public function test_query_tag_slug__in() { 370 370 $posts = $this->q->query( 'tag_slug__in[]=tag-b&tag_slug__in[]=tag-c' ); 371 371 … … 381 381 382 382 383 function test_query_tag__in() {383 public function test_query_tag__in() { 384 384 $tag_a = tag_exists( 'tag-a' ); 385 385 $tag_b = tag_exists( 'tag-b' ); … … 396 396 } 397 397 398 function test_query_tag__not_in() {398 public function test_query_tag__not_in() { 399 399 $tag_a = tag_exists( 'tag-a' ); 400 400 $posts = $this->q->query( 'tag__not_in[]=' . $tag_a['term_id'] ); … … 418 418 } 419 419 420 function test_query_tag__in_but__not_in() {420 public function test_query_tag__in_but__not_in() { 421 421 $tag_a = tag_exists( 'tag-a' ); 422 422 $tag_b = tag_exists( 'tag-b' ); … … 431 431 432 432 433 function test_query_category_name() {433 public function test_query_category_name() { 434 434 $posts = $this->q->query( 'category_name=cat-a' ); 435 435 … … 442 442 } 443 443 444 function test_query_cat() {444 public function test_query_cat() { 445 445 $cat = category_exists( 'cat-b' ); 446 446 $posts = $this->q->query( "cat=$cat" ); … … 454 454 } 455 455 456 function test_query_posts_per_page() {456 public function test_query_posts_per_page() { 457 457 $posts = $this->q->query( 'posts_per_page=5' ); 458 458 … … 469 469 } 470 470 471 function test_query_offset() {471 public function test_query_offset() { 472 472 $posts = $this->q->query( 'offset=2' ); 473 473 … … 489 489 } 490 490 491 function test_query_paged() {491 public function test_query_paged() { 492 492 $posts = $this->q->query( 'paged=2' ); 493 493 … … 510 510 } 511 511 512 function test_query_paged_and_posts_per_page() {512 public function test_query_paged_and_posts_per_page() { 513 513 $posts = $this->q->query( 'paged=4&posts_per_page=4' ); 514 514 … … 528 528 * @ticket 11056 529 529 */ 530 function test_query_post_parent__in() {530 public function test_query_post_parent__in() { 531 531 // Query for first parent's children. 532 532 $posts = $this->q->query( … … 595 595 * @ticket 11056 596 596 */ 597 function test_query_orderby_post_parent__in() {597 public function test_query_orderby_post_parent__in() { 598 598 $posts = $this->q->query( 599 599 array( … … 618 618 * @ticket 39055 619 619 */ 620 function test_query_orderby_post_parent__in_with_order_desc() {620 public function test_query_orderby_post_parent__in_with_order_desc() { 621 621 $post_parent__in_array = array( self::$parent_two, self::$parent_one ); 622 622 $expected_returned_array = array( 'child-three', 'child-four', 'child-one', 'child-two' ); … … 637 637 * @ticket 39055 638 638 */ 639 function test_query_orderby_post__in_with_no_order_specified() {639 public function test_query_orderby_post__in_with_no_order_specified() { 640 640 $post__in_array = array( self::$post_ids[2], self::$post_ids[0], self::$post_ids[1] ); 641 641 $expected_returned_array = array( self::$post_ids[2], self::$post_ids[0], self::$post_ids[1] ); … … 656 656 * @ticket 39055 657 657 */ 658 function test_query_orderby_post__in_with_order_asc() {658 public function test_query_orderby_post__in_with_order_asc() { 659 659 $post__in_array = array( self::$post_ids[2], self::$post_ids[0], self::$post_ids[1] ); 660 660 $expected_returned_array = array( self::$post_ids[2], self::$post_ids[0], self::$post_ids[1] ); … … 676 676 * @ticket 39055 677 677 */ 678 function test_query_orderby_post__in_with_order_desc() {678 public function test_query_orderby_post__in_with_order_desc() { 679 679 $post__in_array = array( self::$post_ids[1], self::$post_ids[2], self::$post_ids[0] ); 680 680 $expected_returned_array = array( self::$post_ids[1], self::$post_ids[2], self::$post_ids[0] ); … … 697 697 * @ticket 39055 698 698 */ 699 function test_query_orderby_post_name__in_with_order_asc() {699 public function test_query_orderby_post_name__in_with_order_asc() { 700 700 $post_name__in_array = array( 'parent-two', 'parent-one', 'parent-three' ); 701 701 … … 714 714 * @ticket 39055 715 715 */ 716 function test_query_orderby_post_name__in_with_order_desc() {716 public function test_query_orderby_post_name__in_with_order_desc() { 717 717 $post_name__in_array = array( 'parent-two', 'parent-one', 'parent-three' ); 718 718 … … 733 733 * @ticket 31194 734 734 */ 735 function test_query_fields_integers() {735 public function test_query_fields_integers() { 736 736 737 737 $parents = array( … … 775 775 * @ticket 28099 776 776 */ 777 function test_empty_post__in() {777 public function test_empty_post__in() { 778 778 $posts1 = $this->q->query( array() ); 779 779 $this->assertNotEmpty( $posts1 ); … … 787 787 * @ticket 19198 788 788 */ 789 function test_exclude_from_search_empty() {789 public function test_exclude_from_search_empty() { 790 790 global $wp_post_types; 791 791 foreach ( array_keys( $wp_post_types ) as $slug ) { … … 811 811 * @ticket 16854 812 812 */ 813 function test_query_author_vars() {813 public function test_query_author_vars() { 814 814 $author_1 = self::factory()->user->create( 815 815 array( … … 983 983 * @ticket 10935 984 984 */ 985 function test_query_is_date() {985 public function test_query_is_date() { 986 986 $this->q->query( 987 987 array( … … 1041 1041 } 1042 1042 1043 function test_perm_with_status_array() {1043 public function test_perm_with_status_array() { 1044 1044 global $wpdb; 1045 1045 $this->q->query( … … 1060 1060 * @ticket 20308 1061 1061 */ 1062 function test_post_password() {1062 public function test_post_password() { 1063 1063 $one = (string) self::factory()->post->create( array( 'post_password' => '' ) ); 1064 1064 $two = (string) self::factory()->post->create( array( 'post_password' => 'burrito' ) ); … … 1151 1151 * @ticket 28611 1152 1152 */ 1153 function test_duplicate_slug_in_hierarchical_post_type() {1153 public function test_duplicate_slug_in_hierarchical_post_type() { 1154 1154 register_post_type( 'handbook', array( 'hierarchical' => true ) ); 1155 1155 … … 1186 1186 * @ticket 29615 1187 1187 */ 1188 function test_child_post_in_hierarchical_post_type_with_default_permalinks() {1188 public function test_child_post_in_hierarchical_post_type_with_default_permalinks() { 1189 1189 register_post_type( 'handbook', array( 'hierarchical' => true ) ); 1190 1190 … … 1214 1214 } 1215 1215 1216 function test_title() {1216 public function test_title() { 1217 1217 $title = 'Tacos are Cool'; 1218 1218 $post_id = self::factory()->post->create(
Note: See TracChangeset
for help on using the changeset viewer.