Changeset 39174 for trunk/tests/phpunit/tests/term/wpInsertTerm.php
- Timestamp:
- 11/09/2016 12:01:42 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/wpInsertTerm.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpInsertTerm.php
r38382 r39174 49 49 $found = wp_insert_term( 'foo', 'bar' ); 50 50 51 $this->assert True( is_wp_error( $found ));51 $this->assertWPError( $found ); 52 52 $this->assertSame( 'invalid_taxonomy', $found->get_error_code() ); 53 53 } … … 58 58 remove_filter( 'pre_insert_term', array( $this, '_pre_insert_term_callback' ) ); 59 59 60 $this->assert True( is_wp_error( $found ));60 $this->assertWPError( $found ); 61 61 $this->assertSame( 'custom_error', $found->get_error_code() ); 62 62 } … … 65 65 $found = wp_insert_term( 0, 'post_tag' ); 66 66 67 $this->assert True( is_wp_error( $found ));67 $this->assertWPError( $found ); 68 68 $this->assertSame( 'invalid_term_id', $found->get_error_code() ); 69 69 } … … 72 72 $found = wp_insert_term( ' ', 'post_tag' ); 73 73 74 $this->assert True( is_wp_error( $found ));74 $this->assertWPError( $found ); 75 75 $this->assertSame( 'empty_term_name', $found->get_error_code() ); 76 76 } … … 81 81 ) ); 82 82 83 $this->assert True( is_wp_error( $found ));83 $this->assertWPError( $found ); 84 84 $this->assertSame( 'missing_parent', $found->get_error_code() ); 85 85 } … … 171 171 // Test an existing term name 172 172 $term2 = self::factory()->tag->create( array( 'name' => 'Bozo' ) ); 173 $this->assert True( is_wp_error( $term2 ));173 $this->assertWPError( $term2 ); 174 174 $this->assertNotEmpty( $term2->errors ); 175 175 … … 180 180 $term6 = self::factory()->tag->create( array( 'name' => 'T$$$$' ) ); 181 181 $term7 = self::factory()->tag->create( array( 'name' => 'T$$$$' ) ); 182 $this->assert True( is_wp_error( $term7 ));182 $this->assertWPError( $term7 ); 183 183 $this->assertNotEmpty( $term7->errors ); 184 184 $this->assertEquals( $term6, $term7->error_data['term_exists'] ); … … 193 193 $term11 = self::factory()->tag->create( array( 'name' => '$$$$' ) ); 194 194 $term12 = self::factory()->tag->create( array( 'name' => '$$$$' ) ); 195 $this->assert True( is_wp_error( $term12 ));195 $this->assertWPError( $term12 ); 196 196 $this->assertNotEmpty( $term12->errors ); 197 197 $this->assertEquals( $term11, $term12->error_data['term_exists'] ); … … 203 203 $this->assertNotWPError( $term13 ); 204 204 $term14 = self::factory()->tag->create( array( 'name' => 'A' ) ); 205 $this->assert True( is_wp_error( $term14 ));205 $this->assertWPError( $term14 ); 206 206 $term15 = self::factory()->tag->create( array( 'name' => 'A+', 'slug' => 'a' ) ); 207 207 $this->assertNotWPError( $term15 ); 208 208 $term16 = self::factory()->tag->create( array( 'name' => 'A+' ) ); 209 $this->assert True( is_wp_error( $term16 ));209 $this->assertWPError( $term16 ); 210 210 $term17 = self::factory()->tag->create( array( 'name' => 'A++' ) ); 211 211 $this->assertNotWPError( $term17 ); … … 213 213 $this->assertNotWPError( $term18 ); 214 214 $term19 = self::factory()->tag->create( array( 'name' => 'A-' ) ); 215 $this->assert True( is_wp_error( $term19 ));215 $this->assertWPError( $term19 ); 216 216 $term20 = self::factory()->tag->create( array( 'name' => 'A--' ) ); 217 217 $this->assertNotWPError( $term20 );
Note: See TracChangeset
for help on using the changeset viewer.