Changeset 922 in tests
- Timestamp:
- 07/19/2012 04:31:22 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/factory.php
r883 r922 118 118 function create_object( $args ) { 119 119 $term_id_pair = wp_insert_term( $args['name'], $args['taxonomy'], $args ); 120 if ( is_wp_error( $term_id_pair ) ) 121 return $term_id_pair; 120 122 return $term_id_pair['term_id']; 121 123 } -
trunk/tests/term.php
r909 r922 24 24 25 25 $t = wp_insert_term( $term, $this->taxonomy ); 26 $this->assert True( is_array($t));26 $this->assertInternalType( 'array', $t ); 27 27 $this->assertFalse( is_wp_error($t) ); 28 28 $this->assertTrue( $t['term_id'] > 0 ); … … 45 45 $term = rand_str(); 46 46 $t = wp_insert_term( $term, $this->taxonomy ); 47 47 $this->assertInternalType( 'array', $t ); 48 48 $this->assertEquals( $t['term_id'], term_exists($t['term_id']) ); 49 49 $this->assertEquals( $t['term_id'], term_exists($term) ); … … 67 67 $term = rand_str(); 68 68 $t = wp_insert_term( $term, $this->taxonomy ); 69 69 $this->assertInternalType( 'array', $t ); 70 70 $term_obj = get_term_by('name', $term, $this->taxonomy); 71 71 $this->assertEquals( $t['term_id'], term_exists($term_obj->slug) ); … … 82 82 $term = rand_str(); 83 83 $result = wp_insert_term( $term, $this->taxonomy ); 84 $this->assertInternalType( 'array', $result ); 84 85 $term_id[$term] = $result['term_id']; 85 86 } … … 175 176 $term = rand_str(); 176 177 $result = wp_insert_term( $term, $this->taxonomy ); 178 $this->assertInternalType( 'array', $result ); 177 179 $terms_1[$i] = $result['term_id']; 178 180 } … … 236 238 237 239 $t = wp_insert_term( $term, 'category' ); 240 $this->assertInternalType( 'array', $t ); 238 241 $t2 = wp_insert_term( $term, 'category', array( 'parent' => $t['term_id'] ) ); 242 $this->assertInternalType( 'array', $t2 ); 239 243 if ( function_exists( 'term_is_ancestor_of' ) ) { 240 244 $this->assertTrue( term_is_ancestor_of( $t['term_id'], $t2['term_id'], 'category' ) ); … … 274 278 // set up test data 275 279 $a = wp_insert_term( 'parent', $this->taxonomy ); 280 $this->assertInternalType( 'array', $a ); 276 281 $b = wp_insert_term( 'child', $this->taxonomy, array( 'parent' => $a['term_id'] ) ); 282 $this->assertInternalType( 'array', $b ); 277 283 $c = wp_insert_term( 'neighbor', $this->taxonomy ); 284 $this->assertInternalType( 'array', $c ); 278 285 $d = wp_insert_term( 'pet', $this->taxonomy, array( 'parent' => $c['term_id'] ) ); 286 $this->assertInternalType( 'array', $c ); 279 287 280 288 $a_term = get_term( $a['term_id'], $this->taxonomy ); -
trunk/tests/xmlrpc/wp/deleteTerm.php
r904 r922 11 11 12 12 $this->term = wp_insert_term( 'term' . rand_str() , 'category' ); 13 $this->assertInternalType( 'array', $this->term ); 13 14 } 14 15 -
trunk/tests/xmlrpc/wp/editTerm.php
r904 r922 13 13 14 14 $this->parent_term = wp_insert_term( 'parent' . rand_str() , 'category' ); 15 $this->assertInternalType( 'array', $this->parent_term ); 15 16 $this->child_term = wp_insert_term( 'child' . rand_str() , 'category' ); 17 $this->assertInternalType( 'array', $this->child_term ); 16 18 $this->post_tag = wp_insert_term( 'test' . rand_str() , 'post_tag' ); 19 $this->assertInternalType( 'array', $this->post_tag ); 17 20 } 18 21 -
trunk/tests/xmlrpc/wp/getTerm.php
r904 r922 11 11 12 12 $this->term = wp_insert_term( 'term' . rand_str() , 'category' ); 13 $this->assertInternalType( 'array', $this->term ); 13 14 } 14 15 -
trunk/tests/xmlrpc/wp/newPost.php
r904 r922 245 245 246 246 $tag1 = wp_create_tag ( rand_str( 30 ) ); 247 $this->assertInternalType( 'array', $tag1 ); 247 248 $tag2 = wp_create_tag ( rand_str( 30 ) ); 249 $this->assertInternalType( 'array', $tag2 ); 248 250 $tag3 = wp_create_tag ( rand_str( 30 ) ); 251 $this->assertInternalType( 'array', $tag3 ); 249 252 250 253 $post = array( -
trunk/tests/xmlrpc/wp/newTerm.php
r904 r922 11 11 12 12 $this->parent_term = wp_insert_term( 'parent' . rand_str(), 'category' ); 13 $this->assertInternalType( 'array', $this->parent_term ); 13 14 $this->parent_term = $this->parent_term['term_id']; 14 15 }
Note: See TracChangeset
for help on using the changeset viewer.