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
... for quite a few report types.
The Reports which PHPCS can generate, were until now not covered by tests and therefore had no safeguards/QA whatsoever.
This commit sets up an initial end-to-end test suite with tests for common report types.
It doesn't have an opinion on whether or not the reports as currently generated are formatted correctly.
For now, it just codifies the current functionality.
For lack of documentation about this format in the PHPUnit docs, the test docs for PHP Core are the closest available to explain the available sections and how to apply these: https://qa.php.net/phpt_details.php
With this initial setup done, it should be fairly straight-forward to expand this end-to-end test suite to cover more report types and to add tests for other command-line options as well.
Mind: these type of tests are generally slow, so unit tests/integration tests should be preferred.
<error line="1" column="1" severity="warning" message="A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 6 and the first side effect is on line 14." source="PSR1.Files.SideEffects.FoundWithSymbols"/>
23
+
<error line="6" column="1" severity="error" message="Each class must be in a namespace of at least one level (a top-level vendor name)" source="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
24
+
<error line="6" column="1" severity="error" message="Class name "dirty_class" is not in PascalCase format" source="Squiz.Classes.ValidClassName.NotCamelCaps"/>
25
+
<error line="7" column="11" severity="error" message="Class constants must be uppercase; expected LOWERCASE but found lowerCase" source="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase"/>
26
+
<error line="9" column="12" severity="error" message="Method name "dirty_class::My_Method" is not in camel caps format" source="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
27
+
<error line="12" column="1" severity="error" message="Each class must be in a file by itself" source="PSR1.Classes.ClassDeclaration.MultipleClasses"/>
28
+
<error line="12" column="1" severity="error" message="Each class must be in a namespace of at least one level (a top-level vendor name)" source="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
29
+
<error line="12" column="1" severity="error" message="Class name "Second_class" is not in PascalCase format" source="Squiz.Classes.ValidClassName.NotCamelCaps"/>
0 commit comments