Skip to content

Conversation

@rodrigoprimo
Copy link
Collaborator

@rodrigoprimo rodrigoprimo commented Sep 18, 2025

Description

In preparation for PHPCS 4.0, which changes the tokenization of namespaced names, this PR adds tests with all variants of namespace names (unqualified, partially qualified, fully qualified, and namespace relative) to the WordPress.Security.EscapeOutput sniff. This is a continuation of #2581, where tests were added for all sniffs extending AbstractFunctionRestrictions except EscapeOutput.

This PR also includes tests to ensure the basename( __FILE__ ) pattern recognition in _deprecated_file() only applies to global basename() function calls, not to other constructs that might look similar (such as namespaced variants or class methods).

@rodrigoprimo
Copy link
Collaborator Author

rodrigoprimo commented Sep 18, 2025

I'm investigating the test that is failing in the PHPCS lowest build.

Fixed and force-pushed. The problem was related to a change in how PHPCS tokenizes FQN exit/die. I added more details in a code comment.

@rodrigoprimo
Copy link
Collaborator Author

Moved to draft pending the review of #2620

@rodrigoprimo rodrigoprimo force-pushed the escape-output-namespaced-names-tests branch from 490c471 to 0d6763d Compare November 14, 2025 14:32
…attern

Add tests to ensure the `basename( __FILE__ )` pattern recognition in `_deprecated_file()` only applies to global `basename()` function calls, not to other constructs that might look similar.
@rodrigoprimo rodrigoprimo force-pushed the escape-output-namespaced-names-tests branch from 0d6763d to 322829b Compare November 14, 2025 14:43
@rodrigoprimo rodrigoprimo marked this pull request as ready for review November 24, 2025 16:04
@rodrigoprimo
Copy link
Collaborator Author

@jrfnl, I'm moving this PR back to ready for review.

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.

1 participant