Changeset 47122 for trunk/tests/phpunit/tests/term/wpInsertTerm.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/wpInsertTerm.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpInsertTerm.php
r46586 r47122 9 9 10 10 _clean_term_filters(); 11 // insert one term into every post taxonomy12 // otherwise term_ids and term_taxonomy_ids might be identical, which could mask bugs11 // Insert one term into every post taxonomy. 12 // Otherwise term_ids and term_taxonomy_ids might be identical, which could mask bugs. 13 13 $term = 'seed_term'; 14 14 foreach ( get_object_taxonomies( 'post' ) as $tax ) { … … 21 21 register_taxonomy( $taxonomy, 'post' ); 22 22 23 // a new unused term23 // A new unused term. 24 24 $term = 'term'; 25 25 $this->assertNull( term_exists( $term ) ); … … 34 34 $this->assertEquals( $initial_count + 1, wp_count_terms( $taxonomy ) ); 35 35 36 // make sure the term exists36 // Make sure the term exists. 37 37 $this->assertTrue( term_exists( $term ) > 0 ); 38 38 $this->assertTrue( term_exists( $t['term_id'] ) > 0 ); 39 39 40 // now delete it40 // Now delete it. 41 41 add_filter( 'delete_term', array( $this, 'deleted_term_cb' ), 10, 5 ); 42 42 $this->assertTrue( wp_delete_term( $t['term_id'], $taxonomy ) ); … … 190 190 $this->assertTrue( empty( $term->errors ) ); 191 191 192 // Test existing term name with unique slug 192 // Test existing term name with unique slug. 193 193 $term1 = self::factory()->tag->create( 194 194 array( … … 199 199 $this->assertNotWPError( $term1 ); 200 200 201 // Test an existing term name 201 // Test an existing term name. 202 202 $term2 = self::factory()->tag->create( array( 'name' => 'Bozo' ) ); 203 203 $this->assertWPError( $term2 ); 204 204 $this->assertNotEmpty( $term2->errors ); 205 205 206 // Test named terms ending in special characters 206 // Test named terms ending in special characters. 207 207 $term3 = self::factory()->tag->create( array( 'name' => 'T$' ) ); 208 208 $term4 = self::factory()->tag->create( array( 'name' => 'T$$' ) ); … … 217 217 $this->assertCount( 4, array_unique( wp_list_pluck( $terms, 'slug' ) ) ); 218 218 219 // Test named terms with only special characters 219 // Test named terms with only special characters. 220 220 $term8 = self::factory()->tag->create( array( 'name' => '$' ) ); 221 221 $term9 = self::factory()->tag->create( array( 'name' => '$$' ) );
Note: See TracChangeset
for help on using the changeset viewer.