You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TokenNameTest: ensure all polyfilled tokens are tested
Other tooling packages will often also polyfill PHP native tokens and are likely to use different values for the token constant (generally an integer above 10.000).
A number of these tool have a habit to autoload the file containing the polyfilled token constants via the Composer `autoload - files` directives.
When this happens, this can interfere with the functioning of PHPCS.
While it will be rare for this to become problematic for normal PHPCS runs (as translation between token constants and their names and visa versa is rarely done in runtime-code), it is definitely something which can cause problems while running the tests for PHPCS itself.
Those type of issues will be hard to debug in the tests as this is a sort of race-condition. So to make it more obvious what is going on if this specific race-condition is happening, I'm going to make it a requirement for all PHP native polyfilled tokens to be tested via the `TokenNameTest` class.
This will ensure that if the race-condition is happening, that test will fail, providing a valuable clue for solving the other resulting test failure(s).
0 commit comments