| 183 | |
| 184 | function test_fields_query() { |
| 185 | |
| 186 | $comment_id1 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 7, 'comment_approved' => '1' ) ); |
| 187 | $comment_id2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); |
| 188 | $comment_id3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id, 'user_id' => 1, 'comment_approved' => '1' ) ); |
| 189 | |
| 190 | $comments = get_comments( array( 'fields' => 'ids' ) ); |
| 191 | $this->assertEquals( 3, count( $comments ) ); |
| 192 | |
| 193 | $this->assertEquals( $comment_id1, $comment1->comment_ID ); |
| 194 | $this->assertEquals( $comment_id2, $comment2->comment_ID ); |
| 195 | $this->assertEquals( $comment_id3, $comment3->comment_ID ); |
| 196 | |
| 197 | } |