diff --git a/tests/phpunit/tests/query/results.php b/tests/phpunit/tests/query/results.php
index 04bdf19..0377142 100644
a
|
b
|
class Tests_Query_Results extends WP_UnitTestCase { |
543 | 543 | ); |
544 | 544 | $this->assertNotContains( "({$wpdb->posts}.post_status = 'publish') AND", $this->q->request ); |
545 | 545 | } |
| 546 | |
| 547 | function test_query_meta_query_order() { |
| 548 | $post1 = $this->factory->post->create( array( 'post_title' => 'meta-value-1', 'post_date' => '2007-01-01 00:00:00' ) ); |
| 549 | $post2 = $this->factory->post->create( array( 'post_title' => 'meta-value-2', 'post_date' => '2007-01-01 00:00:00' ) ); |
| 550 | $post3 = $this->factory->post->create( array( 'post_title' => 'meta-value-3', 'post_date' => '2007-01-01 00:00:00' ) ); |
| 551 | |
| 552 | add_post_meta($post1, 'order', 1); |
| 553 | add_post_meta($post2, 'order', 2); |
| 554 | add_post_meta($post3, 'order', 3); |
| 555 | |
| 556 | $args = array( |
| 557 | 'post_type' => 'post', |
| 558 | 'meta_key' => 'order', |
| 559 | 'meta_value' => 1, |
| 560 | 'meta_compare' => '>=', |
| 561 | 'orderby' => 'meta_value' |
| 562 | ); |
| 563 | |
| 564 | $args2 = array( |
| 565 | 'post_type' => 'post', |
| 566 | 'meta_key' => 'order', |
| 567 | 'meta_value' => 1, |
| 568 | 'meta_compare' => '>=', |
| 569 | 'orderby' => 'meta_value', |
| 570 | 'meta_query' => array( |
| 571 | 'relation' => 'OR', |
| 572 | array( |
| 573 | 'key' => 'order', |
| 574 | 'compare' => '>=', |
| 575 | 'value' => 1 |
| 576 | ) |
| 577 | ) |
| 578 | ); |
| 579 | |
| 580 | $posts = $this->q->query( $args ); |
| 581 | $posts2 = $this->q->query( $args2 ); |
| 582 | |
| 583 | $this->assertEquals(wp_list_pluck( $posts, 'post_title' ), wp_list_pluck( $posts2, 'post_title' )); |
| 584 | } |
546 | 585 | } |