Skip to content

Commit

Permalink
fix: test crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasNorin committed Jan 18, 2024
1 parent a866fe9 commit 3c0f4e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions library/Helper/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public static function getFilteredContent(object $postObject): string
}

// Apply the_content
$excerpt = apply_filters('the_excerpt', $excerpt);
$content = apply_filters('the_content', $content);

if ($postObject->hasQuicklinksAfterFirstBlock) {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/Helper/Post/GetFilteredContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function testContentFilterIsAppliedToContentAndExcerpt()
'hasQuicklinksAfterFirstBlock' => false
]);

WP_Mock::expectFilter('the_content', '<p class="lead">Excerpt</p>');
WP_Mock::expectFilter('the_excerpt', '<p class="lead">Excerpt</p>');
WP_Mock::expectFilter('the_content', '<p>Body</p>');

Post::getFilteredContent($mockPost);
Expand Down

0 comments on commit 3c0f4e1

Please sign in to comment.