Skip to content

Commit

Permalink
Docs: Fix typo in a comment in wp_trim_excerpt().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SergeyBiryukov committed Sep 13, 2023
1 parent 15f5a95 commit 36f8240
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
8 changes: 0 additions & 8 deletions tests/phpunit/tests/formatting/wpTrimExcerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 36f8240

Please sign in to comment.