File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1896,4 +1896,20 @@ public function test_wp_trash_comment_only_top_level_notes_trigger_child_deletio
18961896 // Verify the sibling note is NOT trashed (no cascade since child is not top-level).
18971897 $ this ->assertSame ( '1 ' , get_comment ( $ sibling_note )->comment_approved );
18981898 }
1899+
1900+ /**
1901+ * @ticket 61244
1902+ *
1903+ * @covers ::get_comment
1904+ */
1905+ public function test_get_comment_filter () {
1906+ $ comment_id = self ::factory ()->comment ->create ( array ( 'comment_post_ID ' => self ::$ post_id ) );
1907+
1908+ $ comment = get_comment ( $ comment_id );
1909+ $ this ->assertInstanceOf ( WP_Comment::class, $ comment );
1910+ $ this ->assertSame ( $ comment_id , (int ) $ comment ->comment_ID , 'Expected the same comment. ' );
1911+
1912+ add_filter ( 'get_comment ' , '__return_null ' );
1913+ $ this ->assertNull ( get_comment ( $ comment_id ), 'Expected get_comment() to return null when get_comment filter returns null. ' );
1914+ }
18991915}
You can’t perform that action at this time.
0 commit comments