| 156 | |
| 157 | /** |
| 158 | * Ticket 24826 |
| 159 | */ |
| 160 | function test_comment_query_object() { |
| 161 | $comment_id = $this->factory->comment->create(); |
| 162 | |
| 163 | $query1 = new WP_Comment_Query(); |
| 164 | $this->assertNull( $query1->query_vars ); |
| 165 | $this->assertEmpty( $query1->comments ); |
| 166 | $comments = $query1->query( array( 'status' => 'all' ) ); |
| 167 | $this->assertInternalType( 'array', $query1->query_vars ); |
| 168 | $this->assertNotEmpty( $query1->comments ); |
| 169 | $this->assertInternalType( 'array', $query1->comments ); |
| 170 | |
| 171 | $query2 = new WP_Comment_Query( array( 'status' => 'all' ) ); |
| 172 | $this->assertNotEmpty( $query2->query_vars ); |
| 173 | $this->assertNotEmpty( $query2->comments ); |
| 174 | $this->assertEquals( $query2->comments, $query1->get_comments() ); |
| 175 | } |