mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
Add tests for the conversion of 'meta_*' query vars to $meta_query objects in all query classes.
See #31265. git-svn-id: https://develop.svn.wordpress.org/trunk@31666 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1208,6 +1208,20 @@ class Tests_Query_MetaQuery extends WP_UnitTestCase {
|
||||
$this->assertEqualSets( array( $post_4, $post_3, $post_2, $post_1 ), $query->posts );
|
||||
}
|
||||
|
||||
public function test_meta_vars_should_be_converted_to_meta_query() {
|
||||
$q = new WP_Query( array(
|
||||
'meta_key' => 'foo',
|
||||
'meta_value' => '5',
|
||||
'meta_compare' => '>',
|
||||
'meta_type' => 'SIGNED',
|
||||
) );
|
||||
|
||||
$this->assertSame( 'foo', $q->meta_query->queries[0]['key'] );
|
||||
$this->assertSame( '5', $q->meta_query->queries[0]['value'] );
|
||||
$this->assertSame( '>', $q->meta_query->queries[0]['compare'] );
|
||||
$this->assertSame( 'SIGNED', $q->meta_query->queries[0]['type'] );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 29604
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user