Description
When I run wp-env run cli --env-cwd=wp-content/themes/wordpress-theme composer dumpautoload from Powershell on Windows 11, it builds an incomplete class list in vendor/composer/autoload_classmap.php and an exception is thrown due to a missing class when I run wp-env run cli --env-cwd=wp-content/themes/wordpress-theme ./vendor/bin/pest.
Output:
Generating optimized autoload files (authoritative)
Generated optimized autoload files (authoritative) containing 2002 classes
Test Exception:
ERROR Class "PHPUnit\Metadata\Parser\Registry" not found
Location: /var/www/html/wp-content/themes/wordpress-theme/vendor/phpunit/phpunit/src/Util/Test.php:31
When I run wp-env run wordpress --env-cwd=wp-content/themes/wordpress-theme composer dumpautoload from Powershell on Windows 11, the class list is complete and I am able to run wp-env run cli --env-cwd=wp-content/themes/wordpress-theme ./vendor/bin/pest with passing tests.
Output:
Generating optimized autoload files (authoritative)
Generated optimized autoload files (authoritative) containing 2109 classes
Test Success:
PASS Tests\Feature\ExampleTest
✓ example 0.56s
PASS Tests\Unit\ExampleTest
✓ example 0.15s
Tests: 2 passed (2 assertions)
Duration: 4.63s
My repo is here: https://github.com/ZachWatkins/wordpress-theme
Step-by-step reproduction instructions
- On Windows 11 (and presumably 10), open Powershell.
- Clone the repo:
git clone https://github.com/ZachWatkins/wordpress-theme
- Switch to the repo's directory:
cd wordpress-theme
- If using NVM and not using Node version 18.16.1, then switch to that Node version:
nvm use
- Install NPM dependencies:
npm install
- Start Docker Desktop
- Start the
wp-env package's Docker containers: npm start
- Install Composer dependencies using the
cli environment: npm run wp-env run cli -- --env-cwd=wp-content/themes/wordpress-theme composer install
- Run the tests:
npm run wp-env run cli -- --env-cwd=wp-content/themes/wordpress-theme ./vendor/bin/pest
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Description
When I run
wp-env run cli --env-cwd=wp-content/themes/wordpress-theme composer dumpautoloadfrom Powershell on Windows 11, it builds an incomplete class list invendor/composer/autoload_classmap.phpand an exception is thrown due to a missing class when I runwp-env run cli --env-cwd=wp-content/themes/wordpress-theme ./vendor/bin/pest.Output:
Test Exception:
ERROR Class "PHPUnit\Metadata\Parser\Registry" not found Location: /var/www/html/wp-content/themes/wordpress-theme/vendor/phpunit/phpunit/src/Util/Test.php:31When I run
wp-env run wordpress --env-cwd=wp-content/themes/wordpress-theme composer dumpautoloadfrom Powershell on Windows 11, the class list is complete and I am able to runwp-env run cli --env-cwd=wp-content/themes/wordpress-theme ./vendor/bin/pestwith passing tests.Output:
Test Success:
My repo is here: https://github.com/ZachWatkins/wordpress-theme
Step-by-step reproduction instructions
git clone https://github.com/ZachWatkins/wordpress-themecd wordpress-themenvm usenpm installwp-envpackage's Docker containers:npm startclienvironment:npm run wp-env run cli -- --env-cwd=wp-content/themes/wordpress-theme composer installnpm run wp-env run cli -- --env-cwd=wp-content/themes/wordpress-theme ./vendor/bin/pestScreenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes