Youwe Testing Suite is an all-in-one solution for doing static code analysis on composer packages/projects. It does so both locally and in CI/CD. For this, Testing-suite leverages GrumPHP with predefined default configurations per project type.
- Git blacklist
- Composer file validation
- JSON Lint
- YamlLint
- PHPCS (Coding Standards)
- PHPMD (Mess Detector)
- PHPStan (Find bugs before they reach production)
- PHPUnit (Execute Unit tests)
- PHP Lint
- ESLint (Find and fix problems in your JavaScript code)
- Enlighten Security Checker
Testing suite is supposed to be installed as a composer dev
dependency.
Within any project just run the command below to install the package:
composer require youwe/testing-suite --dev
If a project-type is detected, standards will be applied (otherwise a wizard will be opened)
The testing suite can be run manually through the GrumPHP command.
vendor/bin/grumphp run
or for DDev projects
ddev exec vendor/bin/grumphp run
The testing suite is automatically run at each git commit using a git commit hook.
This git commit hook will automatically detect DDev projects and will run GrumPHP within the DDev container if needed. This behaviour can be disabled:
- on individual basis via an environment variable:
YOUWE_BYPASS_DDEV=1 git commit
- on project basis via the
grumphp.yml
configuration file:
imports:
- resource: 'vendor/youwe/testing-suite/config/your-project-type/grumphp.yml'
grumphp:
git_hook_variables:
# Disable DDev detection by restoring to default `exec`
# See https://github.com/phpro/grumphp/blob/v2.x/doc/parameters.md for more options
EXEC_GRUMPHP_COMMAND: exec
After changing your grumphp.yml
, run vendor/bin/grumphp git:init
to update the git commit hook.
See the Changelog file for all changes.