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
Files/FileList: fix tests to stop interfering with external standards tests
The AddFileTest.php tests introduced an issue that broke the ability to
run sniff tests for external standards using the PHPCS native test
framework.
This problem was happening because `self::initializeConfigAndRuleset()`
was called in a data provider method in `AddFileTest.php`. This means
that the `Config` instance created inside `initializeConfigAndRuleset()`
using `ConfigDouble` was created before `AllSniffs::suite()` had a
chance to get the installed standards from the `CodeSniffer.conf`
configuration file. When `AllSniffs::suite()` runs, `ConfigDouble`
already overrode the `configData` and `configDataFile` properties, and
`CodeSniffer.conf` is never read, and the tests for external standards
were not included.
To fix this problem, I opted to change the test to create an instance of
the `File` class (which requires an instance of the `Config` class) in
the test itself instead of doing that in the data provider.
0 commit comments