Index: .env
===================================================================
--- .env	(revision 49353)
+++ .env	(working copy)
@@ -15,6 +15,18 @@
 # x.y PHP version from 5.2 onwards.
 LOCAL_PHP=latest
 
+# The PHPUnit version to use when running tests.
+#
+# Valid options are 'latest', '{version}-fpm', or {phpunit-version}-php-{version}-fpm, where {version} is any x.y PHP
+# version from 5.2 onwards and {phpunit-version} is any PHPUnit version starting from 4.
+#
+# Support for new PHPUnit versions is not backported to past releases, so some old WordPress branches require an older
+# version to run tests. For full documentation on PHPUnit compatibility and WordPress versions, see
+# https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/.
+#
+# This defaults to the value assigned to the value of LOCAL_PHP.
+LOCAL_PHPUNIT=${LOCAL_PHP}
+
 # Whether or not to enable XDebug.
 LOCAL_PHP_XDEBUG=false
 
Index: docker-compose.yml
===================================================================
--- docker-compose.yml	(revision 49353)
+++ docker-compose.yml	(working copy)
@@ -96,7 +96,7 @@
   # The PHPUnit container.
   ##
   phpunit:
-    image: wordpressdevelop/phpunit:${LOCAL_PHP-latest}
+    image: wordpressdevelop/phpunit:${LOCAL_PHPUNIT-latest}
 
     networks:
       - wpdevnet
Index: package-lock.json
===================================================================
--- package-lock.json	(revision 49353)
+++ package-lock.json	(working copy)
@@ -9135,9 +9135,9 @@
 			}
 		},
 		"dotenv": {
-			"version": "8.1.0",
-			"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.1.0.tgz",
-			"integrity": "sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA==",
+			"version": "8.2.0",
+			"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
+			"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
 			"dev": true
 		},
 		"dotenv-expand": {
Index: package.json
===================================================================
--- package.json	(revision 49353)
+++ package.json	(working copy)
@@ -35,7 +35,7 @@
 		"check-node-version": "4.0.1",
 		"copy-webpack-plugin": "^5.1.1",
 		"cssnano": "4.1.10",
-		"dotenv": "8.1.0",
+		"dotenv": "8.2.0",
 		"dotenv-expand": "5.1.0",
 		"grunt": "~1.1.0",
 		"grunt-banner": "^0.6.0",
Index: tools/local-env/scripts/docker.js
===================================================================
--- tools/local-env/scripts/docker.js	(revision 49353)
+++ tools/local-env/scripts/docker.js	(working copy)
@@ -1,6 +1,8 @@
-const dotenv = require( 'dotenv' );
+const dotenv       = require( 'dotenv' );
+const dotenvExpand = require( 'dotenv-expand' );
 const { execSync } = require( 'child_process' );
-dotenv.config();
+
+dotenvExpand( dotenv.config() );
 
 // Execute any docker-compose command passed to this script.
 execSync( 'docker-compose ' + process.argv.slice( 2 ).join( ' ' ), { stdio: 'inherit' } );
Index: tools/local-env/scripts/install.js
===================================================================
--- tools/local-env/scripts/install.js	(revision 49353)
+++ tools/local-env/scripts/install.js	(working copy)
@@ -1,9 +1,10 @@
-const dotenv = require( 'dotenv' );
+const dotenv       = require( 'dotenv' );
+const dotenvExpand = require( 'dotenv-expand' );
 const wait_on = require( 'wait-on' );
 const { execSync } = require( 'child_process' );
 const { renameSync, readFileSync, writeFileSync } = require( 'fs' );
 
-dotenv.config();
+dotenvExpand( dotenv.config() );
 
 // Create wp-config.php.
 wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' );
Index: tools/local-env/scripts/start.js
===================================================================
--- tools/local-env/scripts/start.js	(revision 49353)
+++ tools/local-env/scripts/start.js	(working copy)
@@ -1,7 +1,8 @@
-const dotenv = require( 'dotenv' );
+const dotenv       = require( 'dotenv' );
+const dotenvExpand = require( 'dotenv-expand' );
 const { execSync } = require( 'child_process' );
 
-dotenv.config();
+dotenvExpand( dotenv.config() );
 
 // Start the local-env containers.
 execSync( 'docker-compose up -d wordpress-develop', { stdio: 'inherit' } );
