Changeset 40293 for trunk/tests/phpunit/tests/term/getTermBy.php
- Timestamp:
- 03/16/2017 02:03:53 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/getTermBy.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTermBy.php
r40275 r40293 206 206 $this->assertEquals( 0, $action->get_call_count() ); 207 207 } 208 209 /** 210 * @ticket 21760 211 */ 212 public function test_get_term_by_name_with_string_0() { 213 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 214 215 $term_id = $this->factory->term->create( array( 216 'name' => '0', 217 'taxonomy' => 'wptests_tax', 218 ) ); 219 220 $found = get_term_by( 'name', '0', 'wptests_tax' ); 221 $this->assertSame( $term_id, $found->term_id ); 222 } 223 224 /** 225 * @ticket 21760 226 */ 227 public function test_get_term_by_slug_with_string_0() { 228 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 229 230 $term_id = $this->factory->term->create( array( 231 'taxonomy' => 'wptests_tax', 232 'name' => '0', 233 'slug' => '0', 234 ) ); 235 236 $found = get_term_by( 'slug', '0', 'wptests_tax' ); 237 $this->assertSame( $term_id, $found->term_id ); 238 } 239 240 /** 241 * @ticket 21760 242 */ 243 public function test_get_term_by_with_empty_string() { 244 register_taxonomy( 'wptests_tax', 'post', array( 'hierarchical' => true ) ); 245 246 $found_by_slug = get_term_by( 'slug', '', 'wptests_tax' ); 247 $found_by_name = get_term_by( 'name', '', 'wptests_tax' ); 248 249 $this->assertFalse( $found_by_slug ); 250 $this->assertFalse( $found_by_name ); 251 } 208 252 }
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)