-
-
Notifications
You must be signed in to change notification settings - Fork 522
AbstractClassRestrictionsSniff sniffs: add tests for namespaced names #2643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
AbstractClassRestrictionsSniff sniffs: add tests for namespaced names #2643
Conversation
|
Moved to draft pending the review of #2620 |
187b5c8 to
420def6
Compare
jrfnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rodrigoprimo for setting this up! Looking good. Just some small remarks to dot the i's and cross the t's.
More tests will be added in a separate file in a subsequent commit.
I opted to add the tests in a separate file as for DeprecatedClassesUnitTest.1.inc the error lines are generated dynamically.
420def6 to
f4099e0
Compare
|
Thanks for your review, @jrfnl. I addressed the points that you raised and, as we discussed, amended the original commits. |
This commit also adds two non-namespaces tests for interfaces as those were missing in the file.
f4099e0 to
a6b8b32
Compare
jrfnl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those updates @rodrigoprimo ! All good from me now.
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
AbstractClassRestrictionsSniffclass when necessary. Some test files already contained part or all of the required tests.For
DeprecatedClasses, I opted to add the tests in a separate file as the error linesDeprecatedClassesUnitTest.1.incare generated dynamically. Since the tests were added to a separate file, I opted to include all possible namespace variations even though a few already exist inDeprecatedClassesUnitTest.1.inc. I didn't want to complicate things by having the namespaced names tests in different files.Suggested changelog entry
N/A