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
Agreed. I'm thinking we should leave this till the summer (2021) when a) there will be an PHP 8.1 alpha/beta to test with locally and b) it will become clearer what PHPUnit versions will support PHP 8.1.
That is, unless a simple, working solution presents itself in the mean time.
One thing I've been thinking about, which is related to this, is to:
either refactor the PHPCS unit test base in PHPCS 3.x to support a wider range of PHPUnit versions, but I'm not sure Greg would be open to this.
or to provide an abstract base test class via PHPCSUtils which would work cross-version PHPUnit and would only require the use statement to be adjusted for external standards to switch over to it.
That last solution would also get rid of the hassle of having to use the GH source for testing against PHPCS 4.x, which no longer includes the test base classes in the distribution zip.
The only real difference would be that it may not include support for adding the 46 sniff test files generated 190 unique error codes; 0 were fixable (0%) line at the bottom of the test run.
Via that last solution, I would also want to offer more extended test abilities, like:
testing that the correct error code is thrown where expected, so a change in a sniff changing the error code being thrown for a particular code snippet won't be "invisible" anymore from a testing perspective.
Case in point - a change in PR IncludingFile: Add custom keywords to detect to reduce false positives #626 is doing exactly that and I caught it in the review, but it would have been easy to overlook.
and testing (for select test cases), that the error message is as expected. This is particularly interesting for sniffs which do things with code snippets in the error message where we'd want to guard that functionality.
Example: the WordPress.PHP.NoSilencedErrors sniff.
The text was updated successfully, but these errors were encountered:
Follow up action after #628
Conversation about this between @GaryJones and @jrfnl from #628:
The text was updated successfully, but these errors were encountered: