Changeset 55671 for trunk/tests/phpunit/tests/term/query.php
- Timestamp:
- 04/21/2023 09:22:04 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/query.php
r55083 r55671 45 45 46 46 $this->assertSameSets( array( $term_2 ), $q->terms ); 47 } 48 49 /** 50 * @ticket 57645 51 */ 52 public function test_lazy_load_term_meta() { 53 $filter = new MockAction(); 54 add_filter( 'update_term_metadata_cache', array( $filter, 'filter' ), 10, 2 ); 55 register_taxonomy( 'wptests_tax_1', 'post' ); 56 register_taxonomy( 'wptests_tax_2', 'post' ); 57 58 $term_1 = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_1' ) ); 59 $term_2 = self::factory()->term->create( array( 'taxonomy' => 'wptests_tax_2' ) ); 60 61 $q = new WP_Term_Query( 62 array( 63 'taxonomy' => 'wptests_tax_1', 64 'fields' => 'ids', 65 'hide_empty' => false, 66 ) 67 ); 68 69 $this->assertSameSets( array( $term_1 ), $q->terms ); 70 71 $q = new WP_Term_Query( 72 array( 73 'taxonomy' => 'wptests_tax_2', 74 'fields' => 'ids', 75 'hide_empty' => false, 76 ) 77 ); 78 79 $this->assertSameSets( array( $term_2 ), $q->terms ); 80 81 get_term_meta( $term_1 ); 82 83 $args = $filter->get_args(); 84 $first = reset( $args ); 85 $term_ids = end( $first ); 86 $this->assertSameSets( $term_ids, array( $term_1, $term_2 ) ); 47 87 } 48 88
Note: See TracChangeset
for help on using the changeset viewer.