Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds the option to provide a custom phpunit command via args #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jayhof
Copy link

@jayhof jayhof commented Aug 30, 2016

This feature extends the php-unit hook to allow a custom command for the php-unit tests. This is useful if you want to use https://github.com/fiunchinho/phpunit-randomizer or if you have a more complicated php configuration running as a docker-container.

To illustrate, here's short excerpt from a composer.json

"scripts": {
  "docker-run": "docker run --rm -v $PWD:/var/www dockerimage:latest",
  "php-unit": "@composer run docker-run -- ./var/www/vendor/bin/phpunit-randomizer -c /var/www/phpunit.xml --order rand",
  "test": "@composer run php-unit"
}

By running composer run test the scripts will start a docker-container and run the unit tests on it instead on your local php installation.

To configure the hook you would use:

id: php-unit
args: ["composer run php-unit"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant