General and shared validation services created as part of the WMDE fundraising software.
To use the fun-validators library in your project, simply add a dependency on wmde/fun-validators
to your project's composer.json
file. Here is a minimal example of a composer.json
file that just defines a dependency on fun-validators 1.x:
{
"require": {
"wmde/fun-validators": "~1.0"
}
}
For development you need to have Docker and compose Docker plugin installed. Local PHP and Composer are not needed.
To install the project dependencies via Composer, run:
make install-php
To update the dependencies, run
make update-php
To update a specific dependency, you can run
make update-php COMPOSER_FLAGS=dependency-name
To run all CI checks, which includes PHPUnit tests, PHPCS style checks and coverage tag validation, run:
make
To run just the PHPUnit tests run
make test
To run only a subset of PHPUnit tests or otherwise pass flags to PHPUnit, run
docker compose run --rm fun-validators ./vendor/bin/phpunit --filter SomeClassNameOrFilter