diff --git tests/phpunit/tests/comment/query.php tests/phpunit/tests/comment/query.php
index 5a7ab9441d..7caff06969 100644
|
|
class Tests_Comment_Query extends WP_UnitTestCase { |
3515 | 3515 | $this->assertSameSets( array_merge( $c1, $c2 ), $found ); |
3516 | 3516 | } |
3517 | 3517 | |
| 3518 | /** |
| 3519 | * @ticket 36208 |
| 3520 | * |
| 3521 | * @covers WP_Comment_Query::query |
| 3522 | */ |
| 3523 | public function test_registered_post_types() { |
| 3524 | register_post_type( 'post-type-1', array( 'exclude_from_search' => false ) ); |
| 3525 | register_post_type( 'post-type-2', array( 'exclude_from_search' => false ) ); |
| 3526 | |
| 3527 | $p1 = self::factory()->post->create( array( 'post_type' => 'post-type-1' ) ); |
| 3528 | $p2 = self::factory()->post->create( array( 'post_type' => 'post-type-2' ) ); |
| 3529 | |
| 3530 | $c1 = self::factory()->comment->create_post_comments( $p1, 1 ); |
| 3531 | $c2 = self::factory()->comment->create_post_comments( $p2, 1 ); |
| 3532 | |
| 3533 | _unregister_post_type( 'post-type-2' ); |
| 3534 | |
| 3535 | $q = new WP_Comment_Query(); |
| 3536 | $found = $q->query( |
| 3537 | array( |
| 3538 | 'fields' => 'ids', |
| 3539 | 'post_type' => array_keys( get_post_types() ), |
| 3540 | ) |
| 3541 | ); |
| 3542 | |
| 3543 | $this->assertSameSets( $c1, $found ); |
| 3544 | } |
| 3545 | |
3518 | 3546 | /** |
3519 | 3547 | * @ticket 35512 |
3520 | 3548 | * |