Changeset 40237
- Timestamp:
- 03/07/2017 05:26:51 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/results.php
r40056 r40237 369 369 * @ticket 39055 370 370 */ 371 function test_query_orderby_post_parent__in_with_order_desc() { 372 $post_parent__in_array = array( self::$parent_two, self::$parent_one ); 373 $expected_returned_array = array( 'child-three', 'child-four', 'child-one', 'child-two' ); 374 375 $posts = $this->q->query( array( 376 'post_parent__in' => $post_parent__in_array, 377 'orderby' => 'post_parent__in', 378 'order' => 'desc', 379 ) ); 380 381 // order=desc does not influence the order of returned results (returns same order as order=asc) 382 $this->assertEquals( $expected_returned_array, wp_list_pluck( $posts, 'post_title' ) ); 383 } 384 385 /** 386 * @ticket 39055 387 */ 371 388 function test_query_orderby_post__in_with_no_order_specified() { 372 389 $post__in_array = array( self::$post_ids[2], self::$post_ids[0], self::$post_ids[1] ); … … 418 435 // Order=desc does not have an effect on the order of returned results 419 436 $this->assertSame( $expected_returned_array, $q->posts ); 437 } 438 439 /** 440 * @ticket 39055 441 */ 442 function test_query_orderby_post_name__in_with_order_asc() { 443 $post_name__in_array = array( 'parent-two', 'parent-one', 'parent-three' ); 444 445 $q = new WP_Query( array( 446 'post_name__in' => $post_name__in_array, 447 'orderby' => 'post_name__in', 448 'order' => 'asc' 449 ) ); 450 451 $this->assertSame( $post_name__in_array, array_unique( wp_list_pluck( $q->posts, 'post_title' ) ) ); 452 } 453 454 /** 455 * @ticket 39055 456 */ 457 function test_query_orderby_post_name__in_with_order_desc() { 458 $post_name__in_array = array( 'parent-two', 'parent-one', 'parent-three' ); 459 460 $q = new WP_Query( array( 461 'post_name__in' => $post_name__in_array, 462 'orderby' => 'post_name__in', 463 'order' => 'desc' 464 ) ); 465 466 // order=desc does not influence the order of returned results (returns same order as order=asc) 467 $this->assertSame( $post_name__in_array, array_unique( wp_list_pluck( $q->posts, 'post_title' ) ) ); 420 468 } 421 469
Note: See TracChangeset
for help on using the changeset viewer.