| 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 | */ |
| 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' ) ) ); |
| 468 | } |
| 469 | |
| 470 | /** |