WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/07/2015 04:34:50 PM (7 years ago)
Author:
boonebgorges
Message:

Add tests for the conversion of 'meta_*' query vars to $meta_query objects in all query classes.

See #31265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query/metaQuery.php

    r31340 r31666  
    12091209    }
    12101210
     1211    public function test_meta_vars_should_be_converted_to_meta_query() {
     1212        $q = new WP_Query( array(
     1213            'meta_key' => 'foo',
     1214            'meta_value' => '5',
     1215            'meta_compare' => '>',
     1216            'meta_type' => 'SIGNED',
     1217        ) );
     1218
     1219        $this->assertSame( 'foo', $q->meta_query->queries[0]['key'] );
     1220        $this->assertSame( '5', $q->meta_query->queries[0]['value'] );
     1221        $this->assertSame( '>', $q->meta_query->queries[0]['compare'] );
     1222        $this->assertSame( 'SIGNED', $q->meta_query->queries[0]['type'] );
     1223    }
     1224
    12111225    /**
    12121226     * @ticket 29604
Note: See TracChangeset for help on using the changeset viewer.