Changeset 26187
- Timestamp:
- 11/15/2013 02:32:16 AM (12 years ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/utils.php
r26006 r26187 383 383 } 384 384 } 385 386 function _clean_term_filters() { 387 remove_filter( 'get_terms', array( 'Featured_Content', 'hide_featured_term' ), 10, 2 ); 388 remove_filter( 'get_the_terms', array( 'Featured_Content', 'hide_the_featured_term' ), 10, 3 ); 389 } -
trunk/tests/phpunit/tests/term.php
r26028 r26187 9 9 function setUp() { 10 10 parent::setUp(); 11 12 _clean_term_filters(); 11 13 // insert one term into every post taxonomy 12 14 // otherwise term_ids and term_taxonomy_ids might be identical, which could mask bugs … … 442 444 wp_set_object_terms( $post_id, $term, $this->taxonomy ); 443 445 444 $term = array_shift( wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'all_with_object_id' ) ) ); 446 $terms = wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'all_with_object_id' ) ); 447 $term = array_shift( $terms ); 445 448 $int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' ); 446 449 foreach ( $int_fields as $field ) 447 450 $this->assertInternalType( 'int', $term->$field, $field ); 448 451 449 $term = array_shift( wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'ids' ) ) ); 452 $terms = wp_get_object_terms( $post_id, $this->taxonomy, array( 'fields' => 'ids' ) ); 453 $term = array_shift( $terms ); 450 454 $this->assertInternalType( 'int', $term, 'term' ); 451 455 } -
trunk/tests/phpunit/tests/term/getTerms.php
r25933 r26187 7 7 function setUp() { 8 8 parent::setUp(); 9 9 10 _clean_term_filters(); 10 11 wp_cache_delete( 'last_changed', 'terms' ); 11 12 } … … 29 30 $terms = get_terms( 'post_tag' ); 30 31 $this->assertEquals( 15, count( $terms ) ); 31 $this->assertNotEmpty( $time1 = wp_cache_get( 'last_changed', 'terms' ) ); 32 $time1 = wp_cache_get( 'last_changed', 'terms' ); 33 $this->assertNotEmpty( $time1 ); 32 34 $this->assertEquals( $num_queries + 1, $wpdb->num_queries ); 33 35
Note: See TracChangeset
for help on using the changeset viewer.