Changeset 25241 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 09/04/2013 07:40:17 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r25164 r25241 151 151 $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms ); 152 152 } 153 154 function test_get_terms_like() { 155 $term_id1 = $this->factory->tag->create( array( 'name' => 'burrito', 'description' => 'This is a burrito.' ) ); 156 $term_id2 = $this->factory->tag->create( array( 'name' => 'taco', 'description' => 'Burning man.' ) ); 157 158 $terms = get_terms( 'post_tag', array( 'hide_empty' => false, 'name__like' => 'bur', 'fields' => 'ids' ) ); 159 $this->assertEqualSets( array( $term_id1 ), $terms ); 160 161 $terms2 = get_terms( 'post_tag', array( 'hide_empty' => false, 'description__like' => 'bur', 'fields' => 'ids' ) ); 162 $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms2 ); 163 164 $terms3 = get_terms( 'post_tag', array( 'hide_empty' => false, 'name__like' => 'Bur', 'fields' => 'ids' ) ); 165 $this->assertEqualSets( array( $term_id1 ), $terms3 ); 166 167 $terms4 = get_terms( 'post_tag', array( 'hide_empty' => false, 'description__like' => 'Bur', 'fields' => 'ids' ) ); 168 $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms4 ); 169 170 $terms5 = get_terms( 'post_tag', array( 'hide_empty' => false, 'name__like' => 'ENCHILADA', 'fields' => 'ids' ) ); 171 $this->assertEmpty( $terms5 ); 172 173 $terms6 = get_terms( 'post_tag', array( 'hide_empty' => false, 'description__like' => 'ENCHILADA', 'fields' => 'ids' ) ); 174 $this->assertEmpty( $terms6 ); 175 176 $terms7 = get_terms( 'post_tag', array( 'hide_empty' => false, 'name__like' => 'o', 'fields' => 'ids' ) ); 177 $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms7 ); 178 179 $terms8 = get_terms( 'post_tag', array( 'hide_empty' => false, 'description__like' => '.', 'fields' => 'ids' ) ); 180 $this->assertEqualSets( array( $term_id1, $term_id2 ), $terms8 ); 181 } 153 182 }
Note: See TracChangeset
for help on using the changeset viewer.