Changeset 37860 for trunk/tests/phpunit/tests/term/query.php
- Timestamp:
- 06/25/2016 04:22:55 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/query.php
r37683 r37860 62 62 $this->assertEqualSets( array( $terms[0], $terms[2] ), $q->terms ); 63 63 } 64 65 /** 66 * @ticket 37151 67 */ 68 public function test_order_by_meta_value_num() { 69 register_taxonomy( 'wptests_tax', 'post' ); 70 71 $terms = self::factory()->term->create_many( 3, array( 'taxonomy' => 'wptests_tax' ) ); 72 73 add_term_meta( $terms[0], 'foo', 10 ); 74 add_term_meta( $terms[1], 'foo', 1 ); 75 add_term_meta( $terms[2], 'foo', 100 ); 76 77 $q = new WP_Term_Query( array( 78 'taxonomy' => array( 'wptests_tax' ), 79 'fields' => 'ids', 80 'hide_empty' => false, 81 'meta_key' => 'foo', 82 'orderby' => 'meta_value_num', 83 ) ); 84 85 $found = array_map( 'intval', $q->terms ); 86 $this->assertSame( array( $terms[1], $terms[0], $terms[2] ), $found ); 87 } 64 88 }
Note: See TracChangeset
for help on using the changeset viewer.