WordPress.org

Make WordPress Core

Changeset 36346


Ignore:
Timestamp:
01/19/2016 03:02:42 AM (4 years ago)
Author:
boonebgorges
Message:

Share post fixture in WP_Comment_Query tests.

See #30017.

File:
1 edited

Legend:

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

    r36345 r36346  
    77 */
    88class Tests_Comment_Query extends WP_UnitTestCase {
    9     protected $post_id;
     9    protected static $post_id;
    1010    protected $comment_id;
     11
     12    public static function wpSetUpBeforeClass( $factory ) {
     13        self::$post_id = $factory->post->create();
     14    }
     15
     16    public static function wpTearDownAfterClass() {
     17        wp_delete_post( self::$post_id, true );
     18    }
    1119
    1220    function setUp() {
    1321        parent::setUp();
    14 
    15         $this->post_id = self::factory()->post->create();
    1622    }
    1723
    1824    public function test_query() {
    19         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    20         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    21         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    22         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    23         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     25        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     26        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     27        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     28        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     29        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    2430
    2531        $q = new WP_Comment_Query();
     
    3238
    3339    public function test_query_post_id_0() {
    34         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
     40        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
    3541
    3642        $q = new WP_Comment_Query();
     
    4753     */
    4854    public function test_query_type_empty_string() {
    49         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    50         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    51         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    52         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    53         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     55        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     56        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     57        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     58        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     59        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    5460
    5561        $q = new WP_Comment_Query();
     
    6672     */
    6773    public function test_query_type_comment() {
    68         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    69         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    70         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    71         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    72         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     74        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     75        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     76        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     77        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     78        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    7379
    7480        $q = new WP_Comment_Query();
     
    8288
    8389    public function test_query_type_pingback() {
    84         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    85         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    86         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    87         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     90        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     91        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     92        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     93        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    8894
    8995        $q = new WP_Comment_Query();
     
    98104
    99105    public function test_query_type_trackback() {
    100         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    101         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    102         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    103         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     106        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     107        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     108        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     109        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    104110
    105111        $q = new WP_Comment_Query();
     
    117123     */
    118124    public function test_query_type_pings() {
    119         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    120         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    121         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    122         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    123         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     125        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     126        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     127        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     128        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     129        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    124130
    125131        $q = new WP_Comment_Query();
     
    137143     */
    138144    public function test_type_array_comments_and_custom() {
    139         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    140         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    141         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    142         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    143         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    144         $c6 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     145        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     146        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     147        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     148        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     149        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     150        $c6 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    145151
    146152        $q = new WP_Comment_Query();
     
    157163     */
    158164    public function test_type_not__in_array_custom() {
    159         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    160         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    161         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    162         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    163         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    164         $c6 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     165        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     166        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     167        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     168        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     169        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     170        $c6 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    165171
    166172        $q = new WP_Comment_Query();
     
    177183     */
    178184    public function test_type__in_array_and_not_type_array_custom() {
    179         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    180         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    181         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    182         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    183         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    184         $c6 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     185        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     186        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     187        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     188        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     189        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     190        $c6 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    185191
    186192        $q = new WP_Comment_Query();
     
    198204     */
    199205    public function test_type_array_and_type__not_in_array_custom() {
    200         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    201         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    202         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    203         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    204         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    205         $c6 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     206        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     207        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     208        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     209        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     210        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     211        $c6 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    206212
    207213        $q = new WP_Comment_Query();
     
    219225     */
    220226    public function test_type__not_in_custom() {
    221         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    222         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    223         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    224         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    225         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    226         $c6 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     227        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     228        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     229        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     230        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     231        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     232        $c6 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    227233
    228234        $q = new WP_Comment_Query();
     
    239245     */
    240246    public function test_type_array_comments_and_pings() {
    241         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    242         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    243         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    244         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
    245         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
     247        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     248        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     249        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     250        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' ) );
     251        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' ) );
    246252
    247253        $q = new WP_Comment_Query();
     
    258264     */
    259265    public function test_type_array_comment_pings() {
    260         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    261         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    262         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     266        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     267        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     268        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    263269
    264270        $q = new WP_Comment_Query();
     
    275281     */
    276282    public function test_type_array_pingback() {
    277         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    278         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    279         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     283        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     284        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     285        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    280286
    281287        $q = new WP_Comment_Query();
     
    292298     */
    293299    public function test_type_array_custom_pingpack() {
    294         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    295         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    296         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     300        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     301        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     302        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    297303
    298304        $q = new WP_Comment_Query();
     
    309315     */
    310316    public function test_type_array_pings() {
    311         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    312         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    313         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     317        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     318        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     319        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    314320
    315321        $q = new WP_Comment_Query();
     
    326332     */
    327333    public function test_type_status_approved_array_comment_pings() {
    328         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    329         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    330         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    331         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0', 'comment_type' => 'pingback' ) );
     334        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     335        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     336        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     337        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0', 'comment_type' => 'pingback' ) );
    332338
    333339        $q = new WP_Comment_Query();
     
    345351     */
    346352    public function test_type_array_trackback() {
    347         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    348         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    349         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     353        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     354        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     355        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    350356
    351357        $q = new WP_Comment_Query();
     
    362368     */
    363369    public function test_type_array_custom_trackback() {
    364         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    365         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    366         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
     370        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     371        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     372        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' ) );
    367373
    368374        $q = new WP_Comment_Query();
     
    379385     */
    380386    public function test_type_array_pings_approved() {
    381         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    382         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    383         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
    384         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0', 'comment_type' => 'trackback' ) );
     387        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     388        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     389        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' ) );
     390        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0', 'comment_type' => 'trackback' ) );
    385391
    386392        $q = new WP_Comment_Query();
     
    398404     */
    399405    public function test_status_empty_string() {
    400         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    401         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
    402         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'spam' ) );
     406        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     407        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
     408        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'spam' ) );
    403409
    404410        $q = new WP_Comment_Query();
     
    415421     */
    416422    public function test_status_hold() {
    417         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    418         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     423        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     424        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    419425
    420426        $q = new WP_Comment_Query();
     
    431437     */
    432438    public function test_status_approve() {
    433         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    434         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     439        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     440        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    435441
    436442        $q = new WP_Comment_Query();
     
    444450
    445451    public function test_status_custom() {
    446         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    447         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );
    448         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo1' ) );
     452        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     453        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo' ) );
     454        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo1' ) );
    449455
    450456        $q = new WP_Comment_Query();
     
    458464
    459465    public function test_status_all() {
    460         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    461         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );
    462         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     466        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     467        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo' ) );
     468        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    463469
    464470        $q = new WP_Comment_Query();
     
    472478
    473479    public function test_status_default_to_all() {
    474         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    475         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );
    476         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     480        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     481        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo' ) );
     482        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    477483
    478484        $q = new WP_Comment_Query();
     
    488494     */
    489495    public function test_status_comma_any() {
    490         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    491         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );
    492         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     496        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     497        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo' ) );
     498        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    493499
    494500        $q = new WP_Comment_Query();
     
    505511     */
    506512    public function test_status_comma_separated() {
    507         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    508         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );
    509         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     513        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     514        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo' ) );
     515        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    510516
    511517        $q = new WP_Comment_Query();
     
    522528     */
    523529    public function test_status_array() {
    524         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    525         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => 'foo' ) );
    526         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '0' ) );
     530        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     531        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => 'foo' ) );
     532        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' ) );
    527533
    528534        $q = new WP_Comment_Query();
     
    620626     */
    621627    function test_orderby_meta() {
    622         $comment_id = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id ) );
    623         $comment_id2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id ) );
    624         $comment_id3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id ) );
     628        $comment_id = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
     629        $comment_id2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
     630        $comment_id3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
    625631
    626632        add_comment_meta( $comment_id, 'key', 'value1', true );
     
    815821    function test_get_comments_by_user() {
    816822        $users = self::factory()->user->create_many( 2 );
    817         self::factory()->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    818         self::factory()->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    819         self::factory()->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
     823        self::factory()->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     824        self::factory()->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
     825        self::factory()->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
    820826
    821827        $comments = get_comments( array(
     
    846852     */
    847853    public function test_get_comments_by_author_url() {
    848         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
    849         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
    850         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar/baz' ) );
     854        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
     855        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
     856        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar/baz' ) );
    851857
    852858        $comments = get_comments( array(
     
    862868     */
    863869    function test_fields_ids_query() {
    864         $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    865         $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    866         $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     870        $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     871        $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     872        $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    867873
    868874        // Ensure we are dealing with integers, and not objects.
     
    880886     */
    881887    function test_fields_comment__in() {
    882         $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    883         $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    884         $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     888        $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     889        $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     890        $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    885891
    886892        $comment_ids = get_comments( array(
     
    896902     */
    897903    function test_fields_comment__not_in() {
    898         $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    899         $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    900         $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     904        $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     905        $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     906        $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    901907
    902908        $comment_ids = get_comments( array(
     
    10421048     */
    10431049    public function test_get_comments_with_status_all() {
    1044         $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1045         $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    1046         $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
     1050        $comment_1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1051        $comment_2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     1052        $comment_3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
    10471053        $comments_approved_1 = get_comments( array( 'status' => 'all' ) );
    10481054
     
    10551061     */
    10561062    public function test_get_comments_with_include_unapproved_user_id() {
    1057         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1058         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    1059         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
    1060         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) );
     1063        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1064        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     1065        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
     1066        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 6, 'comment_approved' => '0' ) );
    10611067
    10621068        $found = get_comments( array(
     
    10731079     */
    10741080    public function test_get_comments_with_include_unapproved_user_id_array() {
    1075         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1076         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    1077         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
    1078         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) );
    1079         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 8, 'comment_approved' => '0' ) );
     1081        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1082        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     1083        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
     1084        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 6, 'comment_approved' => '0' ) );
     1085        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 8, 'comment_approved' => '0' ) );
    10801086
    10811087        $found = get_comments( array(
     
    10921098     */
    10931099    public function test_get_comments_with_include_unapproved_user_id_comma_separated() {
    1094         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1095         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
    1096         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
    1097         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 6, 'comment_approved' => '0' ) );
    1098         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 8, 'comment_approved' => '0' ) );
     1100        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1101        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '1' ) );
     1102        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 1, 'comment_approved' => '0' ) );
     1103        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 6, 'comment_approved' => '0' ) );
     1104        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 8, 'comment_approved' => '0' ) );
    10991105
    11001106        $found = get_comments( array(
     
    11111117     */
    11121118    public function test_get_comments_with_include_unapproved_author_email() {
    1113         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1114         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
    1115         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
    1116         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
     1119        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1120        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
     1121        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
     1122        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
    11171123
    11181124        $found = get_comments( array(
     
    11291135     */
    11301136    public function test_get_comments_with_include_unapproved_mixed_array() {
    1131         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1132         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
    1133         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
    1134         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
    1135         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
     1137        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1138        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
     1139        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
     1140        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
     1141        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
    11361142
    11371143        $found = get_comments( array(
     
    11481154     */
    11491155    public function test_get_comments_with_include_unapproved_mixed_comma_separated() {
    1150         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
    1151         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
    1152         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
    1153         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
    1154         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
     1156        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7, 'comment_approved' => '1' ) );
     1157        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '1', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
     1158        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'foo@example.com' ) );
     1159        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 0, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
     1160        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
    11551161
    11561162        $found = get_comments( array(
     
    11641170
    11651171    public function test_search() {
    1166         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
    1167         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'foo@example.com' ) );
    1168         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
    1169         $c4 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_author_IP' => 'foo.bar' ) );
    1170         $c5 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_content' => 'Nice foo comment' ) );
    1171         $c6 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com' ) );
     1172        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'foo', 'comment_author_email' => 'bar@example.com' ) );
     1173        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'foo@example.com' ) );
     1174        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://foo.bar' ) );
     1175        $c4 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_author_IP' => 'foo.bar' ) );
     1176        $c5 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com', 'comment_content' => 'Nice foo comment' ) );
     1177        $c6 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 4, 'comment_approved' => '0', 'comment_author' => 'bar', 'comment_author_email' => 'bar@example.com', 'comment_author_url' => 'http://example.com' ) );
    11721178
    11731179        $q = new WP_Comment_Query();
     
    14731479        $now = current_time( 'mysql', 1 );
    14741480        $comments = self::factory()->comment->create_many( 5, array(
    1475             'comment_post_ID' => $this->post_id,
     1481            'comment_post_ID' => self::$post_id,
    14761482            'comment_date_gmt' => $now,
    14771483        ) );
     
    14931499        $now = current_time( 'mysql', 1 );
    14941500        $comments = self::factory()->comment->create_many( 5, array(
    1495             'comment_post_ID' => $this->post_id,
     1501            'comment_post_ID' => self::$post_id,
    14961502            'comment_date_gmt' => $now,
    14971503        ) );
     
    15251531
    15261532    public function test_count() {
    1527         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );
    1528         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );
     1533        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7 ) );
     1534        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7 ) );
    15291535
    15301536        $q = new WP_Comment_Query();
     
    15401546     */
    15411547    public function test_count_with_meta_query() {
    1542         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );
    1543         $c2 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );
    1544         $c3 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7 ) );
     1548        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7 ) );
     1549        $c2 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7 ) );
     1550        $c3 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'user_id' => 7 ) );
    15451551        add_comment_meta( $c1, 'foo', 'bar' );
    15461552        add_comment_meta( $c3, 'foo', 'bar' );
     
    17981804    public function test_it_should_be_possible_to_modify_meta_query_using_pre_get_comments_action() {
    17991805        $comments = self::factory()->comment->create_many( 2, array(
    1800             'comment_post_ID' => $this->post_id,
     1806            'comment_post_ID' => self::$post_id,
    18011807        ) );
    18021808
     
    18061812
    18071813        $q = new WP_Comment_Query( array(
    1808             'comment_post_ID' => $this->post_id,
     1814            'comment_post_ID' => self::$post_id,
    18091815            'fields' => 'ids',
    18101816        ) );
     
    18291835    public function test_it_should_be_possible_to_modify_meta_params_using_pre_get_comments_action() {
    18301836        $comments = self::factory()->comment->create_many( 2, array(
    1831             'comment_post_ID' => $this->post_id,
     1837            'comment_post_ID' => self::$post_id,
    18321838        ) );
    18331839
     
    18371843
    18381844        $q = new WP_Comment_Query( array(
    1839             'comment_post_ID' => $this->post_id,
     1845            'comment_post_ID' => self::$post_id,
    18401846            'fields' => 'ids',
    18411847        ) );
     
    18551861     */
    18561862    public function test_parent__in() {
    1857         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
     1863        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
    18581864        $c2 = self::factory()->comment->create( array(
    1859             'comment_post_ID' => $this->post_id,
     1865            'comment_post_ID' => self::$post_id,
    18601866            'comment_approved' => '1',
    18611867            'comment_parent' => $c1,
     
    18631869
    18641870        $ids = new WP_Comment_Query( array(
    1865             'comment_post_ID' => $this->post_id,
     1871            'comment_post_ID' => self::$post_id,
    18661872            'fields' => 'ids',
    18671873            'parent__in' => array( $c1 )
     
    18751881     */
    18761882    public function test_parent__in_commas() {
    1877         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
     1883        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
    18781884        $c2 = self::factory()->comment->create( array(
    1879             'comment_post_ID' => $this->post_id,
     1885            'comment_post_ID' => self::$post_id,
    18801886            'comment_approved' => '1'
    18811887        ) );
    18821888        $c3 = self::factory()->comment->create( array(
    1883             'comment_post_ID' => $this->post_id,
     1889            'comment_post_ID' => self::$post_id,
    18841890            'comment_approved' => '1',
    18851891            'comment_parent' => $c1,
    18861892        ) );
    18871893        $c4 = self::factory()->comment->create( array(
    1888             'comment_post_ID' => $this->post_id,
     1894            'comment_post_ID' => self::$post_id,
    18891895            'comment_approved' => '1',
    18901896            'comment_parent' => $c2,
     
    18921898
    18931899        $ids = new WP_Comment_Query( array(
    1894             'comment_post_ID' => $this->post_id,
     1900            'comment_post_ID' => self::$post_id,
    18951901            'fields' => 'ids',
    18961902            'parent__in' => "$c1,$c2"
     
    19041910     */
    19051911    public function test_parent__not_in() {
    1906         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
     1912        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
    19071913
    19081914        self::factory()->comment->create( array(
    1909             'comment_post_ID' => $this->post_id,
     1915            'comment_post_ID' => self::$post_id,
    19101916            'comment_approved' => '1',
    19111917            'comment_parent' => $c1,
     
    19131919
    19141920        $ids = new WP_Comment_Query( array(
    1915             'comment_post_ID' => $this->post_id,
     1921            'comment_post_ID' => self::$post_id,
    19161922            'fields' => 'ids',
    19171923            'parent__not_in' => array( $c1 )
     
    19251931     */
    19261932    public function test_parent__not_in_commas() {
    1927         $c1 = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
     1933        $c1 = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' ) );
    19281934        $c2 = self::factory()->comment->create( array(
    1929             'comment_post_ID' => $this->post_id,
     1935            'comment_post_ID' => self::$post_id,
    19301936            'comment_approved' => '1'
    19311937        ) );
    19321938
    19331939        self::factory()->comment->create( array(
    1934             'comment_post_ID' => $this->post_id,
     1940            'comment_post_ID' => self::$post_id,
    19351941            'comment_approved' => '1',
    19361942            'comment_parent' => $c1,
    19371943        ) );
    19381944        self::factory()->comment->create( array(
    1939             'comment_post_ID' => $this->post_id,
     1945            'comment_post_ID' => self::$post_id,
    19401946            'comment_approved' => '1',
    19411947            'comment_parent' => $c2,
     
    19431949
    19441950        $ids = new WP_Comment_Query( array(
    1945             'comment_post_ID' => $this->post_id,
     1951            'comment_post_ID' => self::$post_id,
    19461952            'fields' => 'ids',
    19471953            'parent__not_in' => "$c1,$c2"
     
    19561962    public function test_orderby_comment__in() {
    19571963        self::factory()->comment->create( array(
    1958             'comment_post_ID' => $this->post_id,
     1964            'comment_post_ID' => self::$post_id,
    19591965            'comment_approved' => '1'
    19601966        ) );
    19611967
    19621968        $c2 = self::factory()->comment->create( array(
    1963             'comment_post_ID' => $this->post_id,
     1969            'comment_post_ID' => self::$post_id,
    19641970            'comment_approved' => '1'
    19651971        ) );
    19661972        $c3 = self::factory()->comment->create( array(
    1967             'comment_post_ID' => $this->post_id,
     1973            'comment_post_ID' => self::$post_id,
    19681974            'comment_approved' => '1'
    19691975        ) );
    19701976
    19711977        self::factory()->comment->create( array(
    1972             'comment_post_ID' => $this->post_id,
     1978            'comment_post_ID' => self::$post_id,
    19731979            'comment_approved' => '1'
    19741980        ) );
     
    19891995     */
    19901996    public function test_no_found_rows_should_default_to_true() {
    1991         $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );
     1997        $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => self::$post_id ) );
    19921998
    19931999        $q = new WP_Comment_Query( array(
    1994             'post_id' => $this->post_id,
     2000            'post_id' => self::$post_id,
    19952001            'number' => 2,
    19962002        ) );
     
    20042010     */
    20052011    public function test_should_respect_no_found_rows_true() {
    2006         $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );
     2012        $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => self::$post_id ) );
    20072013
    20082014        $q = new WP_Comment_Query( array(
    2009             'post_id' => $this->post_id,
     2015            'post_id' => self::$post_id,
    20102016            'number' => 2,
    20112017            'no_found_rows' => true,
     
    20202026     */
    20212027    public function test_should_respect_no_found_rows_false() {
    2022         $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );
     2028        $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => self::$post_id ) );
    20232029
    20242030        $q = new WP_Comment_Query( array(
    2025             'post_id' => $this->post_id,
     2031            'post_id' => self::$post_id,
    20262032            'number' => 2,
    20272033            'no_found_rows' => false,
     
    20372043    public function test_hierarchical_should_skip_child_comments_in_offset() {
    20382044        $top_level_0 = self::factory()->comment->create( array(
    2039             'comment_post_ID' => $this->post_id,
     2045            'comment_post_ID' => self::$post_id,
    20402046            'comment_approved' => '1',
    20412047        ) );
    20422048
    20432049        $child_of_0 = self::factory()->comment->create( array(
    2044             'comment_post_ID' => $this->post_id,
     2050            'comment_post_ID' => self::$post_id,
    20452051            'comment_approved' => '1',
    20462052            'comment_parent' => $top_level_0,
     
    20482054
    20492055        $top_level_comments = self::factory()->comment->create_many( 3, array(
    2050             'comment_post_ID' => $this->post_id,
     2056            'comment_post_ID' => self::$post_id,
    20512057            'comment_approved' => '1',
    20522058        ) );
    20532059
    20542060        $q = new WP_Comment_Query( array(
    2055             'post_id' => $this->post_id,
     2061            'post_id' => self::$post_id,
    20562062            'hierarchical' => 'flat',
    20572063            'number' => 2,
     
    20702076    public function test_hierarchical_should_not_include_child_comments_in_number() {
    20712077        $top_level_0 = self::factory()->comment->create( array(
    2072             'comment_post_ID' => $this->post_id,
     2078            'comment_post_ID' => self::$post_id,
    20732079            'comment_approved' => '1',
    20742080        ) );
    20752081
    20762082        $child_of_0 = self::factory()->comment->create( array(
    2077             'comment_post_ID' => $this->post_id,
     2083            'comment_post_ID' => self::$post_id,
    20782084            'comment_approved' => '1',
    20792085            'comment_parent' => $top_level_0,
     
    20812087
    20822088        $top_level_comments = self::factory()->comment->create_many( 3, array(
    2083             'comment_post_ID' => $this->post_id,
     2089            'comment_post_ID' => self::$post_id,
    20842090            'comment_approved' => '1',
    20852091        ) );
    20862092
    20872093        $q = new WP_Comment_Query( array(
    2088             'post_id' => $this->post_id,
     2094            'post_id' => self::$post_id,
    20892095            'hierarchical' => 'flat',
    20902096            'number' => 2,
     
    21012107    public function test_hierarchical_threaded() {
    21022108        $c1 = self::factory()->comment->create( array(
    2103             'comment_post_ID' => $this->post_id,
     2109            'comment_post_ID' => self::$post_id,
    21042110            'comment_approved' => '1',
    21052111        ) );
    21062112
    21072113        $c2 = self::factory()->comment->create( array(
    2108             'comment_post_ID' => $this->post_id,
     2114            'comment_post_ID' => self::$post_id,
    21092115            'comment_approved' => '1',
    21102116            'comment_parent' => $c1,
     
    21122118
    21132119        $c3 = self::factory()->comment->create( array(
    2114             'comment_post_ID' => $this->post_id,
     2120            'comment_post_ID' => self::$post_id,
    21152121            'comment_approved' => '1',
    21162122            'comment_parent' => $c2,
     
    21182124
    21192125        $c4 = self::factory()->comment->create( array(
    2120             'comment_post_ID' => $this->post_id,
     2126            'comment_post_ID' => self::$post_id,
    21212127            'comment_approved' => '1',
    21222128            'comment_parent' => $c1,
     
    21242130
    21252131        $c5 = self::factory()->comment->create( array(
    2126             'comment_post_ID' => $this->post_id,
     2132            'comment_post_ID' => self::$post_id,
    21272133            'comment_approved' => '1',
    21282134        ) );
    21292135
    21302136        $c6 = self::factory()->comment->create( array(
    2131             'comment_post_ID' => $this->post_id,
     2137            'comment_post_ID' => self::$post_id,
    21322138            'comment_approved' => '1',
    21332139            'comment_parent' => $c5,
     
    21412147
    21422148        $query_args = array_merge( $args, array(
    2143             'post_id' => $this->post_id,
     2149            'post_id' => self::$post_id,
    21442150        ) );
    21452151
     
    21642170    public function test_hierarchical_threaded_approved() {
    21652171        $c1 = self::factory()->comment->create( array(
    2166             'comment_post_ID' => $this->post_id,
     2172            'comment_post_ID' => self::$post_id,
    21672173            'comment_approved' => '1',
    21682174        ) );
    21692175
    21702176        $c2 = self::factory()->comment->create( array(
    2171             'comment_post_ID' => $this->post_id,
     2177            'comment_post_ID' => self::$post_id,
    21722178            'comment_approved' => '1',
    21732179            'comment_parent' => $c1,
     
    21752181
    21762182        $c3 = self::factory()->comment->create( array(
    2177             'comment_post_ID' => $this->post_id,
     2183            'comment_post_ID' => self::$post_id,
    21782184            'comment_approved' => '0',
    21792185            'comment_parent' => $c2,
     
    21812187
    21822188        $c4 = self::factory()->comment->create( array(
    2183             'comment_post_ID' => $this->post_id,
     2189            'comment_post_ID' => self::$post_id,
    21842190            'comment_approved' => '1',
    21852191            'comment_parent' => $c1,
     
    21872193
    21882194        $c5 = self::factory()->comment->create( array(
    2189             'comment_post_ID' => $this->post_id,
     2195            'comment_post_ID' => self::$post_id,
    21902196            'comment_approved' => '1',
    21912197        ) );
    21922198
    21932199        self::factory()->comment->create( array(
    2194             'comment_post_ID' => $this->post_id,
     2200            'comment_post_ID' => self::$post_id,
    21952201            'comment_approved' => '1',
    21962202            'comment_parent' => $c5,
     
    22052211
    22062212        $query_args = array_merge( $args, array(
    2207             'post_id' => $this->post_id,
     2213            'post_id' => self::$post_id,
    22082214        ) );
    22092215
     
    22252231    public function test_comment_clauses_prepend_callback_should_be_respected_when_filling_descendants() {
    22262232        $top_level_0 = self::factory()->comment->create( array(
    2227             'comment_post_ID' => $this->post_id,
     2233            'comment_post_ID' => self::$post_id,
    22282234            'comment_approved' => '1',
    22292235        ) );
    22302236
    22312237        $child1_of_0 = self::factory()->comment->create( array(
    2232             'comment_post_ID' => $this->post_id,
     2238            'comment_post_ID' => self::$post_id,
    22332239            'comment_approved' => '1',
    22342240            'comment_parent' => $top_level_0,
     
    22362242
    22372243        $child2_of_0 = self::factory()->comment->create( array(
    2238             'comment_post_ID' => $this->post_id,
     2244            'comment_post_ID' => self::$post_id,
    22392245            'comment_approved' => '1',
    22402246            'comment_parent' => $top_level_0,
     
    22422248
    22432249        $top_level_comments = self::factory()->comment->create_many( 3, array(
    2244             'comment_post_ID' => $this->post_id,
     2250            'comment_post_ID' => self::$post_id,
    22452251            'comment_approved' => '1',
    22462252        ) );
     
    22502256        add_filter( 'comments_clauses', array( $this, 'prepend_exclusions' ) );
    22512257        $q = new WP_Comment_Query( array(
    2252             'post_id' => $this->post_id,
     2258            'post_id' => self::$post_id,
    22532259            'hierarchical' => 'flat',
    22542260        ) );
     
    22712277    public function test_comment_clauses_append_callback_should_be_respected_when_filling_descendants() {
    22722278        $top_level_0 = self::factory()->comment->create( array(
    2273             'comment_post_ID' => $this->post_id,
     2279            'comment_post_ID' => self::$post_id,
    22742280            'comment_approved' => '1',
    22752281        ) );
    22762282
    22772283        $child1_of_0 = self::factory()->comment->create( array(
    2278             'comment_post_ID' => $this->post_id,
     2284            'comment_post_ID' => self::$post_id,
    22792285            'comment_approved' => '1',
    22802286            'comment_parent' => $top_level_0,
     
    22822288
    22832289        $child2_of_0 = self::factory()->comment->create( array(
    2284             'comment_post_ID' => $this->post_id,
     2290            'comment_post_ID' => self::$post_id,
    22852291            'comment_approved' => '1',
    22862292            'comment_parent' => $top_level_0,
     
    22882294
    22892295        $top_level_comments = self::factory()->comment->create_many( 3, array(
    2290             'comment_post_ID' => $this->post_id,
     2296            'comment_post_ID' => self::$post_id,
    22912297            'comment_approved' => '1',
    22922298        ) );
     
    22962302        add_filter( 'comments_clauses', array( $this, 'append_exclusions' ) );
    22972303        $q = new WP_Comment_Query( array(
    2298             'post_id' => $this->post_id,
     2304            'post_id' => self::$post_id,
    22992305            'hierarchical' => 'flat',
    23002306        ) );
     
    23542360        global $wpdb;
    23552361
    2356         $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => $this->post_id ) );
     2362        $comments = self::factory()->comment->create_many( 3, array( 'comment_post_ID' => self::$post_id ) );
    23572363        clean_comment_cache( $comments );
    23582364
    23592365        $num_queries = $wpdb->num_queries;
    23602366        $q = new WP_Comment_Query( array(
    2361             'post_id' => $this->post_id,
     2367            'post_id' => self::$post_id,
    23622368            'no_found_rows' => true,
    23632369            'update_comment_post_cache' => false,
     
    23812387        wp_suspend_cache_addition( true );
    23822388
    2383         $c = self::factory()->comment->create( array( 'comment_post_ID' => $this->post_id ) );
     2389        $c = self::factory()->comment->create( array( 'comment_post_ID' => self::$post_id ) );
    23842390
    23852391        $q = new WP_Comment_Query( array(
    2386             'post_id' => $this->post_id,
     2392            'post_id' => self::$post_id,
    23872393        ) );
    23882394
Note: See TracChangeset for help on using the changeset viewer.