Skip to content

Commit 9ebab4a

Browse files
committed
Build/Test Tools: Pin Importer plugin version for PHP < 7.2.
The WordPress Importer plugin now requires PHP 7.2 or higher. The plugin’s unit tests were removed as of [59769] in favor of running only within the plugin’s repository on GitHub instead. [59769] was made during the 6.8 release cycle, so all WP <= 6.7 branches still checkout the latest revision for the plugin before running the PHPUnit test suite. This change modifies the `env:install` script to download version `0.9.0` of the plugin (which is the last version of the Importer plugin that supports PHP < 7.2) when a qualifying version is being tested. Merges [60748] to the 5.7 branch. Props @swissspidy. See #63983. git-svn-id: https://develop.svn.wordpress.org/branches/5.7@60757 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1163675 commit 9ebab4a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/local-env/scripts/install.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ function wp_cli( cmd ) {
5454
function install_wp_importer() {
5555
const testPluginDirectory = 'tests/phpunit/data/plugins/wordpress-importer';
5656

57+
58+
// The final version of the WordPress Importer plugin with support for PHP < 7.2 is 0.9.0.
59+
const phpVersion = parseFloat(process.env.LOCAL_PHP.split('-')[0]);
60+
const branchFlag = phpVersion < 7.2 ? '--branch 0.9.0' : '';
61+
5762
execSync( `docker compose exec -T php rm -rf ${testPluginDirectory}`, { stdio: 'inherit' } );
58-
execSync( `docker compose exec -T php git clone https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
63+
execSync( `docker compose exec -T php git clone ${branchFlag} https://github.com/WordPress/wordpress-importer.git ${testPluginDirectory} --depth=1`, { stdio: 'inherit' } );
5964
}

0 commit comments

Comments
 (0)