Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ If you haven't yet set up your local development environment, refer to the [Setu

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

### Familiar with PHP Coding Standards, PHPStan and PHPUnit?

The following Composer commands can be used:

| Command | Short Command | Description |
|---------|---------------|-------------|
| `composer php-coding-standards` | `composer phpcs` | Runs PHP Coding Standards on the `/src` folder |
| `composer fix-php-coding-standards` | `composer phpcbf` | Fix PHP files to meet PHP Coding Standards on the `/src` folder |
| `composer php-coding-standards-on-tests` | `composer phpcs-tests` | Runs PHP Coding Standards on the `/tests` folder |
| `composer fix-php-coding-standards-on-tests` | `composer phpcbf-tests` | Fix PHP files to meet PHP Coding Standards on the `/tests` folder |
| `composer static-analysis` | `composer phpstan` | Runs PHPStan static analysis with increased memory limit |
| `composer test` | `composer test` | Builds and runs WPUnit tests |

## Write (or modify) a test

If your work creates new functionality, write a test.
Expand Down
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'"
"create-docs": "phpDocumentor --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'",
"phpcs": "vendor/bin/phpcs ./ -s -v",
"phpcbf": "vendor/bin/phpcbf ./ -s -v",
"phpcs-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v",
"phpcbf-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v",
"phpstan": "vendor/bin/phpstan analyse --memory-limit=1250M",
"php-coding-standards": "vendor/bin/phpcs ./ -s -v",
"fix-php-coding-standards": "vendor/bin/phpcbf ./ -s -v",
"php-coding-standards-on-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v",
"fix-php-coding-standards-on-tests": "vendor/bin/phpcbf ./tests --standard=phpcs.tests.xml -s -v",
"php-static-analysis": "vendor/bin/phpstan analyse --memory-limit=1250M",
"test": "vendor/bin/phpunit --verbose --stop-on-failure @additional_args"
}
}