There are currently no tests for php code sniffs
There will be unit tests 1:1 for code sniffs, best practice will be using https://github.com/Symplify/EasyCodingStandardTester
this package can also test csFixers so csFixer unit test should be rewritten also
@boris-brtan I've finally made some time to prepare a test case.
I've used it only on the package, becaus it's simple for me and I see that tests pass by simply running:
vendor/bin/phpunit
Here is the DEMO: https://github.com/shopsys/coding-standards/compare/master...TomasVotruba:testing?expand=1
I'll add more tests in time.
Let me know in commit comments, if you need to know something more.
It looks like interesting topics to have test on sniffs. Thank you @TomasVotruba for your activity and help. But I have to ask - is it good practise to have test on code sniffs? It sounds me like having test on tests. It sounds like interesting idea but maybe not cost effective.
What do you think?
Yes it is important, it's like any other code. Coding standard are not tests. Its a set of services that do something, and like any other service, it should be tested.
It took me 30 minutes to setup completely.
Thank you @TomasVotruba for your insight! I will forward it again to my team.
Many thanks,
it was implemented as part of #308 .