Changeset 26010 for trunk/tests/phpunit/tests/term.php
- Timestamp:
- 11/05/2013 01:18:02 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term.php
r25551 r26010 434 434 } 435 435 436 function test_get_object_terms_types() { 437 $post_id = $this->factory->post->create(); 438 $term = wp_insert_term( 'one', $this->taxonomy ); 439 wp_set_object_terms( $post_id, $term, $this->taxonomy ); 440 441 $term = array_shift( wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'all_with_object_id' ) ) ); 442 $int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' ); 443 foreach ( $int_fields as $field ) 444 $this->assertInternalType( 'int', $term->$field, $field ); 445 446 $term = array_shift( wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'ids' ) ) ); 447 $this->assertInternalType( 'int', $term, 'term' ); 448 } 449 436 450 private function assertPostHasTerms( $post_id, $expected_term_ids, $taxonomy ) { 437 451 $assigned_term_ids = wp_get_object_terms( $post_id, $taxonomy, array(
Note: See TracChangeset
for help on using the changeset viewer.