| @@ 488-499 (lines=12) @@ | ||
| 485 | /** |
|
| 486 | * @ticket 21101 |
|
| 487 | */ |
|
| 488 | public function test_status_hold() |
|
| 489 | { |
|
| 490 | $c1 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' )); |
|
| 491 | $c2 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' )); |
|
| 492 | ||
| 493 | $q = new WP_Comment_Query(); |
|
| 494 | $found = $q->query( |
|
| 495 | array( |
|
| 496 | 'status' => 'hold', |
|
| 497 | 'fields' => 'ids', |
|
| 498 | ) |
|
| 499 | ); |
|
| 500 | ||
| 501 | $this->assertEquals(array( $c2 ), $found); |
|
| 502 | } |
|
| @@ 507-518 (lines=12) @@ | ||
| 504 | /** |
|
| 505 | * @ticket 21101 |
|
| 506 | */ |
|
| 507 | public function test_status_approve() |
|
| 508 | { |
|
| 509 | $c1 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' )); |
|
| 510 | $c2 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '0' )); |
|
| 511 | ||
| 512 | $q = new WP_Comment_Query(); |
|
| 513 | $found = $q->query( |
|
| 514 | array( |
|
| 515 | 'status' => 'approve', |
|
| 516 | 'fields' => 'ids', |
|
| 517 | ) |
|
| 518 | ); |
|
| 519 | ||
| 520 | $this->assertEquals(array( $c1 ), $found); |
|
| 521 | } |
|