scaffold-command icon indicating copy to clipboard operation
scaffold-command copied to clipboard

Fix issue that PHPUnit failed

Open yukihiko-shinoda opened this issue 3 years ago • 0 comments

Note: This is one of example resolution, if there are alternative one, reject this PR.

Since pre-installed PHPUnit 8 is used and failed it.

Error: Looks like you're using PHPUnit 8.5.2. WordPress requires at least PHPUnit 5.4 and is currently only compatible with PHPUnit up to 7.x.
Please use the latest PHPUnit version from the 7.x branch.

WordPress does not support PHPUnit 8 currently. Travis CI introduced phpenv silently, pre-installed PHPUnit is used with priority, composer global bin dir no longer refered without phpenv-composer plugin. @see Plugin to install packages by version with composer global in phpenv environment --ngyuki's diary (Japanese)

Following document no longer be truth. Building a PHP project - Travis CI

Default Build Script

The default build script is PHPUnit. It comes packaged with PHP, but you can also install a specific version in a custom location. If you do install it separately, make sure you invoke the correct version by using the full path.

Travis CI looks for phpunit in the same order as Composer does and uses the first one found.

  1. $COMPOSER_BIN_DIR/phpunit
  2. phpunit found in the directory specified by bin-dir in composer.json
  3. vendor/bin/phpunit
  4. phpunit, which is found on $PATH (typically one that is pre-packaged with the PHP runtime) If your project uses something other than PHPUnit, you can override the default build script.

Sample failed build:

Build #29 - yukihiko-shinoda/staticpress2019 - Travis CI

PHP 7.4 (Bionic)

Job #29.1 - yukihiko-shinoda/staticpress2019 - Travis CI

Trusty (PHP 7.1)

Job #29.4 - yukihiko-shinoda/staticpress2019 - Travis CI

Sample succeed build:

Build #39 - yukihiko-shinoda/staticpress2019 - Travis CI

yukihiko-shinoda avatar Mar 31 '21 12:03 yukihiko-shinoda