|
@@ 81-95 (lines=15) @@
|
| 78 |
|
/** |
| 79 |
|
* @ticket 12668 |
| 80 |
|
*/ |
| 81 |
|
public function test_query_type_comment() |
| 82 |
|
{ |
| 83 |
|
$c1 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' )); |
| 84 |
|
$c2 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' )); |
| 85 |
|
$c3 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' )); |
| 86 |
|
$c4 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' )); |
| 87 |
|
$c5 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' )); |
| 88 |
|
|
| 89 |
|
$q = new WP_Comment_Query(); |
| 90 |
|
$found = $q->query( |
| 91 |
|
array( |
| 92 |
|
'type' => 'comment', |
| 93 |
|
'fields' => 'ids', |
| 94 |
|
) |
| 95 |
|
); |
| 96 |
|
|
| 97 |
|
$this->assertEqualSets(array( $c1 ), $found); |
| 98 |
|
} |
|
@@ 141-155 (lines=15) @@
|
| 138 |
|
/** |
| 139 |
|
* 'pings' is an alias for 'trackback' + 'pingback'. |
| 140 |
|
*/ |
| 141 |
|
public function test_query_type_pings() |
| 142 |
|
{ |
| 143 |
|
$c1 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1' )); |
| 144 |
|
$c2 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'pingback' )); |
| 145 |
|
$c3 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'trackback' )); |
| 146 |
|
$c4 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'mario' )); |
| 147 |
|
$c5 = self::factory()->comment->create(array( 'comment_post_ID' => self::$post_id, 'comment_approved' => '1', 'comment_type' => 'luigi' )); |
| 148 |
|
|
| 149 |
|
$q = new WP_Comment_Query(); |
| 150 |
|
$found = $q->query( |
| 151 |
|
array( |
| 152 |
|
'type' => 'pings', |
| 153 |
|
'fields' => 'ids', |
| 154 |
|
) |
| 155 |
|
); |
| 156 |
|
|
| 157 |
|
$this->assertEqualSets(array( $c2, $c3 ), $found); |
| 158 |
|
} |