From 36f8240cc3b7bcb66d6e5f3a680b3f2dfff38034 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 13 Sep 2023 08:06:26 +0000 Subject: [PATCH] Docs: Fix typo in a comment in `wp_trim_excerpt()`. Includes removing redundant `@covers` tags. There is already an existing annotation for the whole test class, following the [https://docs.phpunit.de/en/9.6/annotations.html#covers PHPUnit recommendation]: > This annotation can be added to the docblock of the test class or the individual test methods. The recommended way is to add the annotation to the docblock of the test class, not to the docblock of the test methods. Follow-up to [56560]. See #58682. git-svn-id: https://develop.svn.wordpress.org/trunk@56561 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 2 +- tests/phpunit/tests/formatting/wpTrimExcerpt.php | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 0e5797fa7e619..73d95df2af65c 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3984,7 +3984,7 @@ function wp_trim_excerpt( $text = '', $post = null ) { /* * Temporarily unhook do_blocks() since excerpt_remove_blocks( $text ) - * handels block rendering needed for excerpt. + * handles block rendering needed for excerpt. */ $filter_block_removed = remove_filter( 'the_content', 'do_blocks', 9 ); diff --git a/tests/phpunit/tests/formatting/wpTrimExcerpt.php b/tests/phpunit/tests/formatting/wpTrimExcerpt.php index d77f322058388..d588c01174030 100644 --- a/tests/phpunit/tests/formatting/wpTrimExcerpt.php +++ b/tests/phpunit/tests/formatting/wpTrimExcerpt.php @@ -153,8 +153,6 @@ public function test_wp_trim_excerpt_does_not_restore_wp_filter_content_tags_if_ * Tests that `wp_trim_excerpt()` does process valid blocks. * * @ticket 58682 - * - * @covers ::wp_trim_excerpt */ public function test_wp_trim_excerpt_check_if_block_renders() { $post = self::factory()->post->create( @@ -172,8 +170,6 @@ public function test_wp_trim_excerpt_check_if_block_renders() { * Tests that `wp_trim_excerpt()` unhooks `do_blocks()` from 'the_content' filter. * * @ticket 58682 - * - * @covers ::wp_trim_excerpt */ public function test_wp_trim_excerpt_unhooks_do_blocks() { $post = self::factory()->post->create(); @@ -200,8 +196,6 @@ static function( $content ) use ( &$has_filter ) { * Tests that `wp_trim_excerpt()` doesn't permanently unhook `do_blocks()` from 'the_content' filter. * * @ticket 58682 - * - * @covers ::wp_trim_excerpt */ public function test_wp_trim_excerpt_should_not_permanently_unhook_do_blocks() { $post = self::factory()->post->create(); @@ -215,8 +209,6 @@ public function test_wp_trim_excerpt_should_not_permanently_unhook_do_blocks() { * Tests that `wp_trim_excerpt()` doesn't restore `do_blocks()` if it was previously unhooked. * * @ticket 58682 - * - * @covers ::wp_trim_excerpt */ public function test_wp_trim_excerpt_does_not_restore_do_blocks_if_previously_unhooked() { $post = self::factory()->post->create();