WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2013 02:32:16 AM (7 years ago)
Author:
wonderboymusic
Message:

Remove the Featured Content term filters when running Unit Tests. Set the return value of wp_get_object_terms() to a var before passing to array_shift() in test_get_object_terms_types(), which expects a var to be passed by reference.

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term.php

    r26028 r26187  
    99    function setUp() {
    1010        parent::setUp();
     11       
     12        _clean_term_filters();
    1113        // insert one term into every post taxonomy
    1214        // otherwise term_ids and term_taxonomy_ids might be identical, which could mask bugs
     
    442444        wp_set_object_terms( $post_id, $term, $this->taxonomy );
    443445
    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 );
    445448        $int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' );
    446449        foreach ( $int_fields as $field )
    447450            $this->assertInternalType( 'int', $term->$field, $field );
    448451
    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 );
    450454        $this->assertInternalType( 'int', $term, 'term' );
    451455    }
Note: See TracChangeset for help on using the changeset viewer.