Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d18cce0

Browse files
committed
Fix issue where unit test does not attach comments to a post
1 parent 0afc79c commit d18cce0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/test-rendering.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ public function setUp() {
1212

1313
public function make_comments( $num, $semantic_linkbacks_type = 'like' ) {
1414
$comments = array();
15+
$post_id = wp_insert_post(['post_title'=>'Some Post']);
1516
for ( $i = 0; $i < $num; $i++ ) {
1617
$id = wp_new_comment(
1718
array(
1819
'comment_author_url' => 'http://example.com/person' . $i,
1920
'comment_author' => 'Person ' . $i,
2021
'comment_type' => 'webmention',
22+
'comment_post_ID' => $post_id
2123
)
2224
);
2325
add_comment_meta( $id, 'semantic_linkbacks_type', $semantic_linkbacks_type );

0 commit comments

Comments
 (0)