Changeset 46188 for trunk/tests/phpunit/tests/meta/query.php
- Timestamp:
- 09/19/2019 03:02:20 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta/query.php
r42343 r46188 739 739 740 740 /** 741 * Verifies only that meta_type_key is passed. See query/metaQuery.php for more complete tests. 742 * 743 * @ticket 43446 744 */ 745 public function test_meta_type_key_should_be_passed_to_meta_query() { 746 $posts = self::factory()->post->create_many( 3 ); 747 748 add_post_meta( $posts[0], 'AAA_FOO_AAA', 'abc' ); 749 add_post_meta( $posts[1], 'aaa_bar_aaa', 'abc' ); 750 add_post_meta( $posts[2], 'aaa_foo_bbb', 'abc' ); 751 add_post_meta( $posts[2], 'aaa_foo_aaa', 'abc' ); 752 753 $q = new WP_Query( 754 array( 755 'meta_key' => 'AAA_foo_.*', 756 'meta_compare_key' => 'REGEXP', 757 'fields' => 'ids', 758 ) 759 ); 760 761 $this->assertEqualSets( array( $posts[0], $posts[2] ), $q->posts ); 762 763 $q = new WP_Query( 764 array( 765 'meta_key' => 'AAA_FOO_.*', 766 'meta_compare_key' => 'REGEXP', 767 'meta_type_key' => 'BINARY', 768 'fields' => 'ids', 769 'fields' => 'ids', 770 ) 771 ); 772 773 $this->assertEqualSets( array( $posts[0] ), $q->posts ); 774 } 775 776 /** 741 777 * This is the clause that ensures that empty arrays are not valid queries. 742 778 */
Note: See TracChangeset
for help on using the changeset viewer.