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
Copy file name to clipboardExpand all lines: TESTING.md
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,26 @@ If a test fails, you can inspect the output.
36
36
37
37
Any errors should be corrected by making applicable code or test changes.
38
38
39
+
## Run PHP CodeSniffer
40
+
41
+
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) checks that all code meets the [PSR-12 Coding Standards](https://www.php-fig.org/psr/psr-12/).
42
+
43
+
To run CodeSniffer on tests, enter the following command:
44
+
45
+
```bash
46
+
vendor/bin/phpcs
47
+
```
48
+
49
+
Any errors should be corrected by either:
50
+
- making applicable code changes
51
+
- (Experimental) running `vendor/bin/phpcbf` to automatically fix coding standards
52
+
53
+
Need to change the coding standard rules applied? Either:
54
+
- ignore a rule in the affected code, by adding `phpcs:ignore {rule}`, where {rule} is the given rule that failed in the above output.
55
+
- edit the [phpcs.tests.xml](phpcs.xml) file.
56
+
57
+
**Rules can be ignored with caution**, but it's essential that rules relating to coding style and inline code commenting / docblocks remain.
58
+
39
59
## Run PHP CodeSniffer for Tests
40
60
41
61
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) checks that all test code meets the [PSR-12 Coding Standards](https://www.php-fig.org/psr/psr-12/).
0 commit comments