You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/tests/connectors/test-class-connector-comments.php
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -457,6 +457,7 @@ public function test_callback_comment_duplicate_trigger() {
457
457
'comment_content' => 'Lorem ipsum dolor...',
458
458
'comment_author' => 'Jim Bean',
459
459
'comment_author_email' => 'jim_bean@example.com',
460
+
'comment_author_url' => '',
460
461
'comment_author_IP' => '::1',
461
462
'comment_post_ID' => $post_id,
462
463
]
@@ -498,6 +499,22 @@ public function test_callback_comment_duplicate_trigger() {
498
499
],
499
500
true
500
501
);
502
+
$comment_id = wp_new_comment( $commentdata );
503
+
504
+
// Manually execute SQL query for duplicate comment ID. "$wpdb->last_result[0]" Undefined index error.
505
+
$dupe = $wpdb->prepare(
506
+
"SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != 'trash' AND ( comment_author = %s AND comment_author_email = %s ) AND comment_content = %s LIMIT 1",
0 commit comments