diff --git a/tests/phpunit/tests/comment/query.php b/tests/phpunit/tests/comment/query.php
index 5d250ea..7a1ad40 100644
a
|
b
|
class Tests_Comment_Query extends WP_UnitTestCase { |
1659 | 1659 | |
1660 | 1660 | /** |
1661 | 1661 | * @ticket 22400 |
| 1662 | * @ticket 35075 |
1662 | 1663 | */ |
1663 | | public function test_comment_cache_key_should_ignore_custom_params() { |
| 1664 | public function test_comment_cache_key_should_not_ignore_custom_query_vars() { |
1664 | 1665 | global $wpdb; |
1665 | 1666 | |
1666 | 1667 | $p = self::factory()->post->create(); |
1667 | 1668 | $c = self::factory()->comment->create( array( 'comment_post_ID' => $p ) ); |
1668 | 1669 | |
| 1670 | $start_num = $wpdb->num_queries; |
| 1671 | |
1669 | 1672 | $q1 = new WP_Comment_Query(); |
1670 | 1673 | $q1->query( array( |
1671 | 1674 | 'post_id' => $p, |
1672 | 1675 | 'fields' => 'ids', |
1673 | 1676 | ) ); |
1674 | 1677 | |
1675 | | $num_queries = $wpdb->num_queries; |
| 1678 | $pre_cache_num = $wpdb->num_queries; |
1676 | 1679 | |
1677 | 1680 | $q2 = new WP_Comment_Query(); |
1678 | 1681 | $q2->query( array( |
… |
… |
class Tests_Comment_Query extends WP_UnitTestCase { |
1681 | 1684 | 'foo' => 'bar', |
1682 | 1685 | ) ); |
1683 | 1686 | |
1684 | | $this->assertSame( $num_queries, $wpdb->num_queries ); |
| 1687 | $this->assertNotEquals( $start_num, $pre_cache_num ); |
| 1688 | $this->assertNotEquals( $pre_cache_num, $wpdb->num_queries ); |
1685 | 1689 | } |
1686 | 1690 | |
1687 | 1691 | /** |
diff --git a/tests/phpunit/tests/post/getPages.php b/tests/phpunit/tests/post/getPages.php
index 5391815..4d44545 100644
a
|
b
|
class Tests_Post_getPages extends WP_UnitTestCase { |
334 | 334 | |
335 | 335 | } |
336 | 336 | |
| 337 | /** |
| 338 | * @ticket 35075 |
| 339 | */ |
| 340 | public function test_comment_cache_key_should_not_ignore_custom_query_vars() { |
| 341 | global $wpdb; |
| 342 | |
| 343 | $page_id = self::factory()->post->create( array('post_type' => 'page') ); |
| 344 | |
| 345 | $start_num = $wpdb->num_queries; |
| 346 | |
| 347 | $p1 = get_pages(array( |
| 348 | 'include' => $page_id |
| 349 | )); |
| 350 | |
| 351 | $pre_cache_num = $wpdb->num_queries; |
| 352 | |
| 353 | $p1 = get_pages(array( |
| 354 | 'include' => $page_id, |
| 355 | 'foo' => 'bar' |
| 356 | )); |
| 357 | |
| 358 | $this->assertNotEquals( $start_num, $pre_cache_num ); |
| 359 | $this->assertNotEquals( $pre_cache_num, $wpdb->num_queries ); |
| 360 | } |
| 361 | |
337 | 362 | function test_wp_list_pages_classes() { |
338 | 363 | $type = 'taco'; |
339 | 364 | register_post_type( $type, array( 'hierarchical' => true, 'public' => true ) ); |
diff --git a/tests/phpunit/tests/term/getTerms.php b/tests/phpunit/tests/term/getTerms.php
index bcd3485..7ef51e4 100644
a
|
b
|
class Tests_Term_getTerms extends WP_UnitTestCase { |
1665 | 1665 | |
1666 | 1666 | } |
1667 | 1667 | |
| 1668 | /** |
| 1669 | * @ticket 35075 |
| 1670 | */ |
| 1671 | public function test_comment_cache_key_should_not_ignore_custom_query_vars() { |
| 1672 | global $wpdb; |
| 1673 | |
| 1674 | $term_id = self::factory()->term->create( array( 'taxonomy' => 'category' ) ); |
| 1675 | |
| 1676 | $start_num = $wpdb->num_queries; |
| 1677 | |
| 1678 | $t1 = get_terms('category', array( |
| 1679 | 'include' => $term_id, |
| 1680 | 'fields' => 'ids' |
| 1681 | )); |
| 1682 | |
| 1683 | $pre_cache_num = $wpdb->num_queries; |
| 1684 | |
| 1685 | $t2 = get_terms('category', array( |
| 1686 | 'include' => $term_id, |
| 1687 | 'fields' => 'ids', |
| 1688 | 'foo' => 'bar' |
| 1689 | )); |
| 1690 | |
| 1691 | $this->assertNotEquals( $start_num, $pre_cache_num ); |
| 1692 | $this->assertNotEquals( $pre_cache_num, $wpdb->num_queries ); |
| 1693 | } |
| 1694 | |
1668 | 1695 | protected function create_hierarchical_terms_and_posts() { |
1669 | 1696 | $terms = array(); |
1670 | 1697 | |