Changeset 53169 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 04/13/2022 02:55:34 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r52010 r53169 4942 4942 return array( get_comment( $c ) ); 4943 4943 } 4944 4945 /** 4946 * @ticket 55460 4947 */ 4948 public function test_comment_cache_key_should_ignore_unset_params() { 4949 $p = self::factory()->post->create(); 4950 $c = self::factory()->comment->create( array( 'comment_post_ID' => $p ) ); 4951 4952 $_args = array( 4953 'post_id' => $p, 4954 'fields' => 'ids', 4955 'update_comment_meta_cache' => true, 4956 'update_comment_post_cache' => false, 4957 ); 4958 4959 $q1 = new WP_Comment_Query(); 4960 $q1->query( $_args ); 4961 4962 $num_queries_all_args = get_num_queries(); 4963 4964 // Ignore 'fields', 'update_comment_meta_cache', 'update_comment_post_cache'. 4965 unset( $_args['fields'], $_args['update_comment_meta_cache'], $_args['update_comment_post_cache'] ); 4966 $q2 = new WP_Comment_Query(); 4967 $q2->query( $_args ); 4968 4969 $this->assertSame( $num_queries_all_args, get_num_queries() ); 4970 } 4944 4971 }
Note: See TracChangeset
for help on using the changeset viewer.