Changeset 52010 for trunk/tests/phpunit/tests/term/getTermBy.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTermBy.php
r51462 r52010 6 6 class Tests_Term_GetTermBy extends WP_UnitTestCase { 7 7 8 function test_get_term_by_slug() {8 public function test_get_term_by_slug() { 9 9 $term1 = wp_insert_term( 'Foo', 'category', array( 'slug' => 'foo' ) ); 10 10 $term2 = get_term_by( 'slug', 'foo', 'category' ); … … 12 12 } 13 13 14 function test_get_term_by_name() {14 public function test_get_term_by_name() { 15 15 $term1 = wp_insert_term( 'Foo', 'category', array( 'slug' => 'foo' ) ); 16 16 $term2 = get_term_by( 'name', 'Foo', 'category' ); … … 18 18 } 19 19 20 function test_get_term_by_id() {20 public function test_get_term_by_id() { 21 21 $term1 = wp_insert_term( 'Foo', 'category', array( 'slug' => 'foo' ) ); 22 22 $term2 = get_term_by( 'id', $term1['term_id'], 'category' ); … … 27 27 * 'term_id' is an alias of 'id'. 28 28 */ 29 function test_get_term_by_term_id() {29 public function test_get_term_by_term_id() { 30 30 $term1 = wp_insert_term( 'Foo', 'category', array( 'slug' => 'foo' ) ); 31 31 $term2 = get_term_by( 'term_id', $term1['term_id'], 'category' ); … … 36 36 * @ticket 45163 37 37 */ 38 function test_get_term_by_uppercase_id() {38 public function test_get_term_by_uppercase_id() { 39 39 $term1 = wp_insert_term( 'Foo', 'category', array( 'slug' => 'foo' ) ); 40 40 $term2 = get_term_by( 'ID', $term1['term_id'], 'category' ); … … 45 45 * @ticket 21651 46 46 */ 47 function test_get_term_by_tt_id() {47 public function test_get_term_by_tt_id() { 48 48 $term1 = wp_insert_term( 'Foo', 'category' ); 49 49 $term2 = get_term_by( 'term_taxonomy_id', $term1['term_taxonomy_id'], 'category' ); … … 51 51 } 52 52 53 function test_get_term_by_unknown() {53 public function test_get_term_by_unknown() { 54 54 wp_insert_term( 'Foo', 'category', array( 'slug' => 'foo' ) ); 55 55 $term2 = get_term_by( 'unknown', 'foo', 'category' ); … … 60 60 * @ticket 33281 61 61 */ 62 function test_get_term_by_with_nonexistent_id_should_return_false() {62 public function test_get_term_by_with_nonexistent_id_should_return_false() { 63 63 $term = get_term_by( 'id', 123456, 'category' ); 64 64 $this->assertFalse( $term );
Note: See TracChangeset
for help on using the changeset viewer.