How to set composer.json to install some vendors on development environment different than on production eg. PHPUnit install on development and not on production.
You can use require-dev section for this:
"require-dev": {
"phpunit/phpunit": "~4.7"
}
If you want to install only packages from "require", e.g. on your production server, you can do it like this:
composer install --no-dev
It will exclude "require-dev" packages, see composer install
options docs for more.