Skip to content

Commit 715a58a

Browse files
authored
Merge pull request #108 from Kit/add-composer-commands
Add Composer Commands
2 parents d532506 + c1ed992 commit 715a58a

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

TESTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ If you haven't yet set up your local development environment, refer to the [Setu
1414

1515
If you haven't yet created a branch and made any code changes, refer to the [Development Guide](DEVELOPMENT.md)
1616

17+
### Familiar with PHP Coding Standards, PHPStan and PHPUnit?
18+
19+
The following Composer commands can be used:
20+
21+
| Command | Short Command | Description |
22+
|---------|---------------|-------------|
23+
| `composer php-coding-standards` | `composer phpcs` | Runs PHP Coding Standards on the `/src` folder |
24+
| `composer fix-php-coding-standards` | `composer phpcbf` | Fix PHP files to meet PHP Coding Standards on the `/src` folder |
25+
| `composer php-coding-standards-on-tests` | `composer phpcs-tests` | Runs PHP Coding Standards on the `/tests` folder |
26+
| `composer fix-php-coding-standards-on-tests` | `composer phpcbf-tests` | Fix PHP files to meet PHP Coding Standards on the `/tests` folder |
27+
| `composer static-analysis` | `composer phpstan` | Runs PHPStan static analysis with increased memory limit |
28+
| `composer test` | `composer test` | Builds and runs WPUnit tests |
29+
1730
## Write (or modify) a test
1831

1932
If your work creates new functionality, write a test.

composer.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@
3939
"minimum-stability": "dev",
4040
"prefer-stable": true,
4141
"scripts": {
42-
"create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'"
42+
"create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'",
43+
"phpcs": "vendor/bin/phpcs ./ -s -v",
44+
"phpcbf": "vendor/bin/phpcbf ./ -s -v",
45+
"phpcs-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v",
46+
"phpcbf-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v",
47+
"phpstan": "vendor/bin/phpstan analyse --memory-limit=1250M",
48+
"php-coding-standards": "vendor/bin/phpcs ./ -s -v",
49+
"fix-php-coding-standards": "vendor/bin/phpcbf ./ -s -v",
50+
"php-coding-standards-on-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v",
51+
"fix-php-coding-standards-on-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v",
52+
"php-static-analysis": "vendor/bin/phpstan analyse --memory-limit=1250M",
53+
"test": "vendor/bin/phpunit --verbose --stop-on-failure @additional_args"
4354
}
4455
}

0 commit comments

Comments
 (0)