Add ValidTestClassName sniff to enforce test class naming conventions#2595
Closed
prab18hat wants to merge 1 commit intoWordPress:developfrom
prab18hat:feature/test-class-naming-conventions
Closed
Add ValidTestClassName sniff to enforce test class naming conventions#2595prab18hat wants to merge 1 commit intoWordPress:developfrom prab18hat:feature/test-class-naming-conventions
prab18hat wants to merge 1 commit intoWordPress:developfrom
prab18hat:feature/test-class-naming-conventions
Conversation
- Ensures test class names end with 'Test' - Requires PascalCase for class names - Verifies class names match filenames - Only checks classes extending test case classes - Includes comprehensive test cases
jrfnl
reviewed
Sep 2, 2025
Member
jrfnl
left a comment
There was a problem hiding this comment.
@prab18hat Thank you for your interest in contributing to the WordPress Coding Standards project.
Unfortunately, this PR will not be merged.
- ❌ It shows no understanding of the existing codebase.
- ❌ It doesn't use the available utility methods.
- ❌ It doesn't follow the correct test conventions.
- etc
In other words, the amount of coaching which would be needed to get this into an even remotely mergable state is too much.
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.
Fixes #2484
This PR adds a new sniff
WordPress.NamingConventions.ValidTestClassNamethat enforces consistent test class naming across the codebase.What's included:
Testing: