mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Editor: Ensure latest comments can only be viewed from public posts.
Props: poena, xknown. git-svn-id: https://develop.svn.wordpress.org/trunk@47984 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -289,6 +289,24 @@ class WP_Test_Block_Render extends WP_UnitTestCase {
|
||||
$this->assertEquals( $global_post, $post );
|
||||
}
|
||||
|
||||
public function test_render_latest_comments_on_password_protected_post() {
|
||||
$post_id = self::factory()->post->create(
|
||||
array(
|
||||
'post_password' => 'password',
|
||||
)
|
||||
);
|
||||
$comment_text = wp_generate_password( 10, false );
|
||||
self::factory()->comment->create(
|
||||
array(
|
||||
'comment_post_ID' => $post_id,
|
||||
'comment_content' => $comment_text,
|
||||
)
|
||||
);
|
||||
$comments = do_blocks( '<!-- wp:latest-comments {"commentsToShow":1,"displayExcerpt":true} /-->' );
|
||||
|
||||
$this->assertNotContains( $comment_text, $comments );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 45109
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user