Closed kasparsd closed 5 years ago
Doesn't this mean that phpunit will always be downloaded even if it isn't needed? Should this check if phpunit is already a dependency in Composer before doing this?
@westonruter See the description of #305.
Doesn't this mean that phpunit will always be downloaded even if it isn't needed?
We're still leaving in the check_should_execute 'phpunit'
check. I don't think we've ever had any other checks for this. There is always an option to disable the phpunit checks with DEV_LIB_SKIP
.
Should this check if phpunit is already a dependency in Composer before doing this?
Hard to do that reliably, I think. The order of binary directories in $PATH
ensures that we use the Composer version if it exists.
The can_generate_coverage_clover
function does have some logic to sniff the composer.json
for something being installed:
@westonruter Yes. And we've had issues related to that before when php-coveralls
renamed their packages.
We currently install the following tools by default -- phpcs, grunt, jshint, jscs, eslint and phpunit. Some of them are only installed when a relevant config file is found.
We could check if $PHPUNIT_CONFIG
is not empty but that would be a breaking change. I suggest we keep installing it for now.
This fixed the AMP plugin build: https://github.com/ampproject/amp-wp/pull/2750 👍
Fixes #305.
[x] Introduce new helpers
php_is_atleast()
andphp_is_above()
for readability purposes. Deprecatemin_php_version()
.[x] Install the correct version of phpunit for each version of PHP.