Make WordPress Core

Ticket #35075: 35075.test.patch

File 35075.test.patch, 1.1 KB (added by jason_the_adams, 9 years ago)
  • tests/phpunit/tests/comment/query.php

    diff --git a/tests/phpunit/tests/comment/query.php b/tests/phpunit/tests/comment/query.php
    index 5d250ea..f344d1d 100644
    a b class Tests_Comment_Query extends WP_UnitTestCase { 
    16581658        }
    16591659
    16601660        /**
    1661          * @ticket 22400
     1661         * @ticket 35075
    16621662         */
    1663         public function test_comment_cache_key_should_ignore_custom_params() {
     1663        public function test_comment_cache_key_should_cache_custom_params() {
    16641664                global $wpdb;
    16651665
    16661666                $p = self::factory()->post->create();
    16671667                $c = self::factory()->comment->create( array( 'comment_post_ID' => $p ) );
    16681668
     1669    $start_num = $wpdb->num_queries;
     1670
    16691671                $q1 = new WP_Comment_Query();
    16701672                $q1->query( array(
    16711673                        'post_id' => $p,
    16721674                        'fields' => 'ids',
    16731675                ) );
    16741676
    1675                 $num_queries = $wpdb->num_queries;
    1676 
    16771677                $q2 = new WP_Comment_Query();
    16781678                $q2->query( array(
    16791679                        'post_id' => $p,
    class Tests_Comment_Query extends WP_UnitTestCase { 
    16811681                        'foo' => 'bar',
    16821682                ) );
    16831683
    1684                 $this->assertSame( $num_queries, $wpdb->num_queries );
     1684                $this->assertSame( $start_num + 2, $wpdb->num_queries );
    16851685        }
    16861686
    16871687        /**