Skip to content

AbstractFunctionParameter sniffs: add tests for namespaced names#2633

Merged
jrfnl merged 15 commits intoWordPress:developfrom
rodrigoprimo:abstract-function-parameter-sniffs-tests
Apr 23, 2026
Merged

AbstractFunctionParameter sniffs: add tests for namespaced names#2633
jrfnl merged 15 commits intoWordPress:developfrom
rodrigoprimo:abstract-function-parameter-sniffs-tests

Conversation

@rodrigoprimo
Copy link
Copy Markdown
Contributor

Description

In preparation for PHPCS 4.0, which changes the tokenization of namespaced names, this PR adds tests with all forms of namespaced function calls (partially qualified, fully qualified, and namespace-relative using the 'namespace' keyword) as well as fully qualified global function calls to the sniffs that extend the AbstractFunctionParameterSniff class when necessary. Some test files already contained part or all of the required tests.

Tests for WordPress.WP.EnqueuedResourceParameters are not included in this PR as they would conflict with #2630. I will add tests for this sniff in a separate PR once #2630 is merged.

In some cases, it was necessary to move syntax error tests to a separate file before adding the new tests.

Suggested changelog entry

N/A

@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

Moved to draft pending the review of #2620

@rodrigoprimo rodrigoprimo force-pushed the abstract-function-parameter-sniffs-tests branch from fbcdd23 to 1b63aec Compare November 14, 2025 18:52
@rodrigoprimo rodrigoprimo force-pushed the abstract-function-parameter-sniffs-tests branch from 1b63aec to 6040916 Compare December 9, 2025 19:23
@rodrigoprimo rodrigoprimo force-pushed the abstract-function-parameter-sniffs-tests branch 2 times, most recently from 2db68b0 to d476988 Compare December 9, 2025 19:29
@rodrigoprimo rodrigoprimo marked this pull request as ready for review December 9, 2025 19:41
@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

@jrfnl, since another PR was reviewed earlier today, I'm marking this one as ready for review now.

Comment thread WordPress/Tests/WP/DeprecatedParametersUnitTest.inc Outdated
Copy link
Copy Markdown
Member

@jrfnl jrfnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rodrigoprimo Thanks for all your work on this and your patience waiting for the review.

All good from me!

@jrfnl jrfnl added this to the 3.4.0 milestone Mar 19, 2026
@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

@GaryJones and @dingo-d, would either of you be available to review this PR? It already has one approval. Thanks.

I'm adding three different tests for fully qualified global function calls to cover all the global functions that are referenced directly in the `I18nSniff::process_matched_token()` method.
@rodrigoprimo rodrigoprimo force-pushed the abstract-function-parameter-sniffs-tests branch from 0da6a56 to eac44b4 Compare April 23, 2026 14:11
@rodrigoprimo
Copy link
Copy Markdown
Contributor Author

As discussed in a chat, I squashed the commit applying changes discussed during the PR review into the original commit that adds tests for WordPress.WP.DeprecatedParameters.

@jrfnl jrfnl merged commit 1f6e183 into WordPress:develop Apr 23, 2026
31 checks passed
@rodrigoprimo rodrigoprimo deleted the abstract-function-parameter-sniffs-tests branch April 23, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants