Changeset 38099 for trunk/tests/phpunit/tests/term/query.php
- Timestamp:
- 07/19/2016 02:12:48 AM (9 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
r37860 r38099 86 86 $this->assertSame( array( $terms[1], $terms[0], $terms[2] ), $found ); 87 87 } 88 89 /** 90 * @ticket 37378 91 */ 92 public function test_order_by_keyword_should_not_be_duplicated_when_filtered() { 93 register_taxonomy( 'wptests_tax', 'post' ); 94 95 add_filter( 'terms_clauses', array( $this, 'filter_terms_clauses' ) ); 96 $q = new WP_Term_Query( array( 97 'taxonomy' => array( 'wptests_tax' ), 98 'orderby' => 'name', 99 ) ); 100 remove_filter( 'terms_clauses', array( $this, 'filter_terms_clauses' ) ); 101 102 $this->assertContains( 'ORDER BY tt.term_id', $q->request ); 103 $this->assertNotContains( 'ORDER BY ORDER BY', $q->request ); 104 } 105 106 public function filter_terms_clauses( $clauses ) { 107 $clauses['orderby'] = 'ORDER BY tt.term_id'; 108 return $clauses; 109 } 88 110 }
Note: See TracChangeset
for help on using the changeset viewer.