Changeset 28374 for trunk/tests/phpunit/tests/taxonomy.php
- Timestamp:
- 05/13/2014 03:26:51 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/taxonomy.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy.php
r25923 r28374 169 169 $this->assertTrue( in_category( $term['term_id'], $post ) ); 170 170 } 171 172 function test_insert_category_create() { 173 $cat = array( 174 'cat_ID' => 0, 175 'taxonomy' => 'category', 176 'cat_name' => 'test1' 177 ); 178 $this->assertTrue( is_numeric( wp_insert_category( $cat, true ) ) ); 179 } 180 181 function test_insert_category_update() { 182 $cat = array( 183 'cat_ID' => 1, 184 'taxonomy' => 'category', 185 'cat_name' => 'Updated Name' 186 ); 187 $this->assertEquals( 1, wp_insert_category( $cat ) ); 188 } 189 190 function test_insert_category_force_error_handle() { 191 $cat = array( 192 'cat_ID' => 0, 193 'taxonomy' => 'force_error', 194 'cat_name' => 'Error' 195 ); 196 $this->assertTrue( is_a( wp_insert_category( $cat, true ), 'WP_Error' ) ); 197 } 198 199 function test_insert_category_force_error_no_handle() { 200 $cat = array( 201 'cat_ID' => 0, 202 'taxonomy' => 'force_error', 203 'cat_name' => 'Error' 204 ); 205 $this->assertEquals( 0, wp_insert_category( $cat, false ) ); 206 } 171 207 }
Note: See TracChangeset
for help on using the changeset viewer.