Changeset 56585 for trunk/tests/phpunit/tests/term/getTerms.php
- Timestamp:
- 09/14/2023 12:38:04 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTerms.php
r56548 r56585 3027 3027 3028 3028 /** 3029 * @ticket 52710 3030 */ 3031 public function test_get_terms_without_update_get_terms_cache() { 3032 $this->set_up_three_posts_and_tags(); 3033 3034 $num_queries = get_num_queries(); 3035 3036 // last_changed and num_queries should bump. 3037 $terms = get_terms( 3038 'post_tag', 3039 array( 3040 'cache_results' => false, 3041 'update_term_meta_cache' => false, 3042 ) 3043 ); 3044 $this->assertCount( 3, $terms, 'After running get_terms, 3 terms should be returned' ); 3045 $this->assertSame( $num_queries + 2, get_num_queries(), 'There should be only 2 queries run, only term query and priming terms' ); 3046 3047 $num_queries = get_num_queries(); 3048 3049 // last_changed and num_queries should bump again. 3050 $terms = get_terms( 3051 'post_tag', 3052 array( 3053 'cache_results' => false, 3054 'update_term_meta_cache' => false, 3055 ) 3056 ); 3057 $this->assertCount( 3, $terms, 'After running get_terms for a second time, 3 terms should be returned' ); 3058 $this->assertSame( $num_queries + 1, get_num_queries(), 'On the second run, only run the term query, priming terms happens on the first run' ); 3059 } 3060 3061 /** 3029 3062 * @ticket 35935 3030 3063 */
Note: See TracChangeset
for help on using the changeset viewer.