Changeset 40293 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 03/16/2017 02:03:53 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/getTerms.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r38382 r40293 2224 2224 } 2225 2225 2226 /** 2227 * @ticket 21760 2228 */ 2229 public function test_with_term_slug_equal_to_string_0() { 2230 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 2231 2232 $term_id = self::factory()->term->create( array( 2233 'name' => '0', 2234 'slug' => '0', 2235 'taxonomy' => 'wptests_tax', 2236 ) ); 2237 2238 $found = get_terms( array( 2239 'taxonomy' => 'wptests_tax', 2240 'hide_empty' => 0, 2241 'slug' => '0', 2242 ) ); 2243 2244 $this->assertEqualSets( array( $term_id ), wp_list_pluck( $found, 'term_id' ) ); 2245 } 2246 2247 /** 2248 * @ticket 21760 2249 */ 2250 public function test_with_multiple_term_slugs_one_equal_to_string_0() { 2251 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 2252 2253 $term_id1 = self::factory()->term->create( array( 2254 'name' => '0', 2255 'slug' => '0', 2256 'taxonomy' => 'wptests_tax', 2257 ) ); 2258 2259 $term_id2 = self::factory()->term->create( array( 2260 'name' => 'Test', 2261 'slug' => 'test', 2262 'taxonomy' => 'wptests_tax', 2263 ) ); 2264 2265 $found = get_terms( array( 2266 'taxonomy' => 'wptests_tax', 2267 'hide_empty' => 0, 2268 'slug' => array( 2269 '0', 2270 'test', 2271 ), 2272 ) ); 2273 2274 $this->assertEqualSets( array( $term_id1, $term_id2 ), wp_list_pluck( $found, 'term_id' ) ); 2275 } 2276 2226 2277 protected function create_hierarchical_terms_and_posts() { 2227 2278 $terms = array();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)