diff --git tests/phpunit/tests/comment/query.php tests/phpunit/tests/comment/query.php
index 5a7ab9441d..7caff06969 100644
--- tests/phpunit/tests/comment/query.php
+++ tests/phpunit/tests/comment/query.php
@@ -3515,6 +3515,34 @@ class Tests_Comment_Query extends WP_UnitTestCase {
 		$this->assertSameSets( array_merge( $c1, $c2 ), $found );
 	}
 
+	/**
+	 * @ticket 36208
+	 *
+	 * @covers WP_Comment_Query::query
+	 */
+	public function test_registered_post_types() {
+		register_post_type( 'post-type-1', array( 'exclude_from_search' => false ) );
+		register_post_type( 'post-type-2', array( 'exclude_from_search' => false ) );
+
+		$p1 = self::factory()->post->create( array( 'post_type' => 'post-type-1' ) );
+		$p2 = self::factory()->post->create( array( 'post_type' => 'post-type-2' ) );
+
+		$c1 = self::factory()->comment->create_post_comments( $p1, 1 );
+		$c2 = self::factory()->comment->create_post_comments( $p2, 1 );
+
+		_unregister_post_type( 'post-type-2' );
+
+		$q     = new WP_Comment_Query();
+		$found = $q->query(
+			array(
+				'fields'    => 'ids',
+				'post_type' => array_keys( get_post_types() ),
+			)
+		);
+
+		$this->assertSameSets( $c1, $found );
+	}
+
 	/**
 	 * @ticket 35512
 	 *
