Build/Test Tools: Add NPM script for using the Composer installed version of PHPUnit.
The `test:php` NPM script runs the PHP test suite using the system installed version of PHPUnit. In some cases, the version of PHPUnit installed through Composer may be preferred. Currently, this is true when running the test suite using PHP 8. In order to add support for PHP 8 while maintaining compatibility for PHP 5.6.20, PHPUnit 7.x must be used. But, some modifications are required to be compatible with PHP 8 (see [49037], [48957]). This change introduces the `test:php-composer` NPM script, which will run the test suite using the composer installed version. Props desrosj, SergeyBiryukov. Fixes #51456. git-svn-id: https://develop.svn.wordpress.org/trunk@49099 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
26a18bc72c
commit
683ecf8c6a
12
.travis.yml
12
.travis.yml
@ -42,12 +42,12 @@ jobs:
|
||||
script:
|
||||
# The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated,
|
||||
# as PHPUnit 7 is no longer supported, so run the Composer-installed PHPUnit instead.
|
||||
- docker-compose run --rm phpunit php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist
|
||||
- docker-compose run --rm phpunit php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group ajax
|
||||
- docker-compose run --rm phpunit php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml
|
||||
- docker-compose run --rm phpunit php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
|
||||
- docker-compose run --rm phpunit php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
|
||||
- docker-compose run --rm phpunit php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group restapi-jsclient
|
||||
- npm run test:php-composer --verbose -c phpunit.xml.dist
|
||||
- npm run test:php-composer --verbose -c phpunit.xml.dist --group ajax
|
||||
- npm run test:php-composer --verbose -c tests/phpunit/multisite.xml
|
||||
- npm run test:php-composer --verbose -c tests/phpunit/multisite.xml --group ms-files
|
||||
- npm run test:php-composer --verbose -c phpunit.xml.dist --group external-http
|
||||
- npm run test:php-composer --verbose -c phpunit.xml.dist --group restapi-jsclient
|
||||
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
|
||||
# Xdebug supports PHP 8 only from version 3.0, which is not released yet.
|
||||
# Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.
|
||||
|
@ -167,6 +167,7 @@
|
||||
"env:logs": "node ./tools/local-env/scripts/docker.js logs",
|
||||
"env:pull": "node ./tools/local-env/scripts/docker.js pull",
|
||||
"test:php": "node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit",
|
||||
"test:php-composer": "node ./tools/local-env/scripts/docker.js run --rm phpunit php ./vendor/bin/phpunit",
|
||||
"test:e2e": "node ./tests/e2e/run-tests.js"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user