Make WordPress Core

Changeset 1056 in tests for trunk/tests/comment.php


Ignore:
Timestamp:
09/27/2012 06:08:54 PM (12 years ago)
Author:
ryan
Message:

WP_Comment_Query tests. see #WP21101

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/comment.php

    r1035 r1056  
    11<?php
    2 
    3 // Test the output of Comment Querying functions
    4 
    5 /**
    6  * @group comment
    7  */
    8 class Test_Comment_Query extends WP_UnitTestCase {
    9     var $comment_id;
    10 
    11     function setUp() {
    12         parent::setUp();
    13 
    14         $this->comment_id = $this->factory->comment->create();
    15     }
    16 
    17     /**
    18      * @ticket 21101
    19      */
    20     function test_get_comment_comment_approved_0() {
    21         $comments_approved_0 = get_comments( array( 'comment_approved' => '0' ) );
    22         $this->assertEquals( 0, count( $comments_approved_0 ) );
    23     }
    24 
    25     /**
    26      * @ticket 21101
    27      */
    28     function test_get_comment_comment_approved_1() {
    29         $comments_approved_1 = get_comments( array( 'comment_approved' => '1' ) );
    30 
    31         $this->assertEquals( 1, count( $comments_approved_1 ) );
    32         $result = $comments_approved_1[0];
    33 
    34         $this->assertEquals( $this->comment_id, $result->comment_ID );
    35     }
    36 }
    372
    383/**
Note: See TracChangeset for help on using the changeset viewer.