'closed', ); self::$post_with_comments_disabled = self::factory()->post->create_and_get( $args ); } public static function wpTearDownAfterClass() { wp_delete_post( self::$post_with_comments_disabled->ID, true ); } /** * @covers ::render_block_core_comments */ public function test_render_block_core_comments_empty_output_if_comments_disabled() { $attributes = array(); $parsed_blocks = parse_blocks( '
' ); $parsed_block = $parsed_blocks[0]; $context = array( 'postId' => self::$post_with_comments_disabled->ID ); $block = new WP_Block( $parsed_block, $context ); $rendered = gutenberg_render_block_core_comments( $attributes, '', $block ); $this->assertEmpty( $rendered ); } }