wmde/fun-validators

Name: fun-validators

Owner: Wikimedia Deutschland e.V.

Description: General and shared validation services created as part of the WMDE fundraising software

Created: 2017-11-01 06:51:48.0

Updated: 2017-11-01 07:22:16.0

Pushed: 2018-02-09 11:40:51.0

Homepage:

Size: 36

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

fun-validators

Build Status Latest Stable Version Download count

General and shared validation services created as part of the WMDE fundraising software.

We moved away from this form of validators in favour of a simpler approach though are still using the ones in this library in some of our older UseCases.

Installation

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"
}

Development

For development you need to have Docker and Docker-compose installed. Local PHP and Composer are not needed.

sudo apt-get install docker docker-compose
Running Composer

To pull in the project dependencies via Composer, run:

make composer install

You can run other Composer commands via make run, but at present this does not support argument flags. If you need to execute such a command, you can do so in this format:

docker run --rm --interactive --tty --volume $PWD:/app -w /app\
 --volume ~/.composer:/composer --user $(id -u):$(id -g) composer composer install -vvv
Running the CI checks

To run all CI checks, which includes PHPUnit tests, PHPCS style checks and coverage tag validation, run:

make
Running the tests

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-7.1 ./vendor/bin/phpunit --filter SomeClassNameOrFilter

If you have failing unit tests but want to run them for all PHP versions (normally it would bail on the first error) you can do so using

make -i test

In this case do keep in mind that the exit code can not be used to assess the run's success.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.