Make WordPress Core

Changeset 38211


Ignore:
Timestamp:
08/07/2016 04:42:07 AM (8 years ago)
Author:
wonderboymusic
Message:

Taxononmy: add unit that shows that WP_Term_Query is broken when the query is read from the cache.

See #37591.

File:
1 edited

Legend:

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

    r38181 r38211  
    143143        return $clauses;
    144144    }
     145
     146    /**
     147     * @ticket 37591
     148     */
     149    public function test_terms_is_set() {
     150        register_taxonomy( 'wptests_tax_1', 'post' );
     151
     152        self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) );
     153
     154        $q1 = new WP_Term_Query( array(
     155            'taxonomy' => 'wptests_tax_1',
     156            'hide_empty' => false
     157        ) );
     158
     159        $this->assertNotEmpty( $q1->terms );
     160
     161        $q2 = new WP_Term_Query( array(
     162            'taxonomy' => 'wptests_tax_1',
     163            'hide_empty' => false
     164        ) );
     165
     166        $this->assertNotEmpty( $q2->terms );
     167    }
    145168}
Note: See TracChangeset for help on using the changeset viewer.