Repository navigation
Tests: Add unit coverage for comment_excerpt() - #15281
Draft
shail-mehta wants to merge 1 commit into
Draft
shail-mehta wants to merge 1 commit into
shail-mehta wants to merge 1 commit into
Conversation
Add unit tests for excerpt display output, comment objects, global fallback, and the display filter. See #65819.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for this test-only addition of PHPUnit coverage for comment excerpt behavior.
No open issues 🎉
What changed in this PR
Adds dedicated PHPUnit coverage for comment_excerpt() as part of the #65819 test cleanup effort. This is a test-only change with no production code changes.
Changes:
- Tests echoed output with a comment ID or comment object.
- Covers the global comment fallback and display-filter customization.
- Adds explicit coverage annotations for
comment_excerpt()andget_comment_excerpt().
| File | Description |
|---|---|
tests/phpunit/tests/comment/commentExcerpt.php |
Adds four tests covering excerpt output, accepted inputs, global fallback, and filtering. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket: #65819
What
Adds a dedicated PHPUnit class for
comment_excerpt(), covering display output, comment objects, the global comment fallback, and the display filter.Test-only; no production code changes.
Why
comment_excerpt()had no direct@coverscoverage. Small helper coverage fits the #65819 test cleanup track.How
Add
tests/phpunit/tests/comment/commentExcerpt.phpwith@covers ::comment_excerptand@covers ::get_comment_excerpt.Testing Instructions
npm run test:php -- --filter Tests_Comment_CommentExcerptnpm run test:php -- --filter Tests_Comment_CommentExcerpt -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Comment_CommentExcerpt --order-by=randomnpm run test:php -- --group commentUse of AI Tools