WordPress.org

Make WordPress Core

Changeset 41188


Ignore:
Timestamp:
07/30/2017 02:42:56 PM (2 years ago)
Author:
boonebgorges
Message:

Ensure that an assertion takes place in Tests_Comment_Query::test_comment_query_should_be_cached().

Missed during [37608]. See #36906.

Fixes #41357.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/query.php

    r39274 r41188  
    26632663        global $wpdb;
    26642664
    2665         $q = new WP_Comment_Query( array(
    2666             'post_id' => self::$post_id,
    2667             'fields' => 'ids',
    2668         ) );
    2669 
    26702665        $c = wp_insert_comment( array(
    26712666            'comment_author' => 'Foo',
     
    26742669        ) );
    26752670
     2671        $q = new WP_Comment_Query( array(
     2672            'post_id' => self::$post_id,
     2673            'fields' => 'ids',
     2674        ) );
     2675
    26762676        $num_queries = $wpdb->num_queries;
     2677
     2678        $q2 = new WP_Comment_Query( array(
     2679            'post_id' => self::$post_id,
     2680            'fields' => 'ids',
     2681        ) );
     2682
     2683        $this->assertSame( $num_queries, $wpdb->num_queries );
    26772684    }
    26782685
Note: See TracChangeset for help on using the changeset viewer.