This PR can be summarized in the following changelog entry:
N/A
Relevant technical choices:
The unit tests for ACF have a minimum PHP requirement of PHP 5.6 due to the dependency on BrainMonkey.
At this time, the only PHPUnit version supported was PHPUnit 5.x. However, as the minimum PHP requirement is 5.6 anyway, it is quite easy to make the unit tests compatible with PHPUnit 5.x - 7.x.
PHPUnit 5.x will run on PHP 5.6 - 7.1.
PHPUnit 6.x will run on PHP 7.0 - 7.2.
PHPUnit 7.x will run on PHP 7.1 - 7.3.
Background:
The classes in PHPUnit have been renamed to namespaced classes.
The namespaced alias for the TestCase class is available as of PHPUnit 5.4 and as of PHPUnit 6.0, the non-namespaced versions are no longer available.
As PHPUnit 5.4 is available to use on PHP 5.6, all that is needed to make the test suite compatible with PHPUnit 5.x - 7.x, is to switch over to using the namespaced PHPUnit classes.
Includes a minor tweak to the PHPCS ruleset to get round a "modern PHP not (yet) fully accounted for correctly" bug in WPCS.
CI/QA: minor tweaks to the phpunit.xml.dist file
The specs for the phpunit.xml.dist file have changed numerous times over the years with new options being added and outdated options being removed.
These specs are contained in a schema XSD file for each minor PHPUnit version.
This commit:
Updates the link to the XSD schema used;
Makes the dependency on the Composer autoload file as a test bootstrap explicit.
Fixes the indentation to tabs.
Test instructions
This PR can be tested by following these steps:
With local installs of various PHPUnit (phars) versions, run phpunit.
Alternatively, run a composer update phpunit/phpunit on various PHP versions to install higher versions of PHPUnit, then run composer test. Rinse repeat for other PHP versions.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
The unit tests for ACF have a minimum PHP requirement of PHP 5.6 due to the dependency on BrainMonkey.
At this time, the only PHPUnit version supported was PHPUnit 5.x. However, as the minimum PHP requirement is 5.6 anyway, it is quite easy to make the unit tests compatible with PHPUnit 5.x - 7.x.
PHPUnit 5.x will run on PHP 5.6 - 7.1. PHPUnit 6.x will run on PHP 7.0 - 7.2. PHPUnit 7.x will run on PHP 7.1 - 7.3.
For now, PHPUnit 7.x will also work fine for PHP 7.4 (unstable), so supporting PHPUnit 8.x is not yet necessary. Ref: https://phpunit.de/supported-versions.html
Background: The classes in PHPUnit have been renamed to namespaced classes. The namespaced alias for the TestCase class is available as of PHPUnit 5.4 and as of PHPUnit 6.0, the non-namespaced versions are no longer available.
As PHPUnit 5.4 is available to use on PHP 5.6, all that is needed to make the test suite compatible with PHPUnit 5.x - 7.x, is to switch over to using the namespaced PHPUnit classes.
Includes a minor tweak to the PHPCS ruleset to get round a "modern PHP not (yet) fully accounted for correctly" bug in WPCS.
CI/QA: minor tweaks to the phpunit.xml.dist file
The specs for the
phpunit.xml.dist
file have changed numerous times over the years with new options being added and outdated options being removed. These specs are contained in a schema XSD file for each minor PHPUnit version.This commit:
Test instructions
This PR can be tested by following these steps:
phpunit
.composer update phpunit/phpunit
on various PHP versions to install higher versions of PHPUnit, then runcomposer test
. Rinse repeat for other PHP versions.