|
@@ 1955-1971 (lines=17) @@
|
| 1952 |
|
/** |
| 1953 |
|
* @ticket 20006 |
| 1954 |
|
*/ |
| 1955 |
|
public function test_post_name_array() |
| 1956 |
|
{ |
| 1957 |
|
$p1 = self::factory()->post->create(array( 'post_name' => 'foo' )); |
| 1958 |
|
$p2 = self::factory()->post->create(array( 'post_name' => 'bar' )); |
| 1959 |
|
$p3 = self::factory()->post->create(array( 'post_name' => 'baz' )); |
| 1960 |
|
|
| 1961 |
|
$c1 = self::factory()->comment->create_post_comments($p1, 1); |
| 1962 |
|
$c2 = self::factory()->comment->create_post_comments($p2, 1); |
| 1963 |
|
$c3 = self::factory()->comment->create_post_comments($p3, 1); |
| 1964 |
|
|
| 1965 |
|
$q = new WP_Comment_Query(); |
| 1966 |
|
$found = $q->query( |
| 1967 |
|
array( |
| 1968 |
|
'fields' => 'ids', |
| 1969 |
|
'post_name' => array( 'foo', 'baz' ), |
| 1970 |
|
) |
| 1971 |
|
); |
| 1972 |
|
|
| 1973 |
|
$this->assertEqualSets(array_merge($c1, $c3), $found); |
| 1974 |
|
} |
|
@@ 2020-2036 (lines=17) @@
|
| 2017 |
|
/** |
| 2018 |
|
* @ticket 20006 |
| 2019 |
|
*/ |
| 2020 |
|
public function test_post_status_array() |
| 2021 |
|
{ |
| 2022 |
|
$p1 = self::factory()->post->create(array( 'post_status' => 'publish' )); |
| 2023 |
|
$p2 = self::factory()->post->create(array( 'post_status' => 'draft' )); |
| 2024 |
|
$p3 = self::factory()->post->create(array( 'post_status' => 'future' )); |
| 2025 |
|
|
| 2026 |
|
$c1 = self::factory()->comment->create_post_comments($p1, 1); |
| 2027 |
|
$c2 = self::factory()->comment->create_post_comments($p2, 1); |
| 2028 |
|
$c3 = self::factory()->comment->create_post_comments($p3, 1); |
| 2029 |
|
|
| 2030 |
|
$q = new WP_Comment_Query(); |
| 2031 |
|
$found = $q->query( |
| 2032 |
|
array( |
| 2033 |
|
'fields' => 'ids', |
| 2034 |
|
'post_status' => array( 'publish', 'future' ), |
| 2035 |
|
) |
| 2036 |
|
); |
| 2037 |
|
|
| 2038 |
|
$this->assertEqualSets(array_merge($c1, $c3), $found); |
| 2039 |
|
} |