Skip to content

Commit

Permalink
Build/Test Tools: Improve Composer update command in bootstrap error …
Browse files Browse the repository at this point in the history
…messages.

Refines the test bootstrap error message to include the `-W` in the Composer update command.

Why?

To also update the chain of dependencies for the tests' dependencies. 

`composer update` will update the tests' direct dependencies.
 
`composer update -W` will update the dependencies including *their* dependencies, which is the recommended course of action for WP.

Follow-up to [51598], [51811], [51813].

Props jrf.
See #46149.

git-svn-id: https://develop.svn.wordpress.org/trunk@51828 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
hellofromtonya committed Sep 20, 2021
1 parent e881178 commit fe9f6a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/phpunit/includes/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
* {@link https://make.wordpress.org/core/handbook/testing/automated-testing/phpunit/#test-running-workflow-options}
*
* Plugin/theme integration tests can handle this in any of the following ways:
* - When using a full WP install: run `composer update` for the WP install prior to running the tests.
* - When using a full WP install: run `composer update -W` for the WP install prior to running the tests.
* - When using a partial WP test suite install:
* - Add a `yoast/phpunit-polyfills` (dev) requirement to the plugin/theme's own `composer.json` file.
* - And then:
Expand Down Expand Up @@ -112,7 +112,7 @@
echo 'The WP_TESTS_PHPUNIT_POLYFILLS_PATH constant should contain an absolute path to the root directory'
. ' of the PHPUnit Polyfills library.' . PHP_EOL;
} elseif ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
echo 'You need to run `composer update` before running the tests.' . PHP_EOL;
echo 'You need to run `composer update -W` before running the tests.' . PHP_EOL;
echo 'Once the dependencies are installed, you can run the tests using the Composer-installed version'
. ' of PHPUnit or using a PHPUnit phar file, but the dependencies do need to be installed'
. ' whichever way the tests are run.' . PHP_EOL;
Expand All @@ -123,7 +123,7 @@
. ' or set the absolute path to the PHPUnit Polyfills library in a "WP_TESTS_PHPUNIT_POLYFILLS_PATH"'
. ' constant to allow the WP Core bootstrap to load the Polyfills.' . PHP_EOL . PHP_EOL;
echo 'If you are trying to run the WP Core tests, make sure to set the "WP_RUN_CORE_TESTS" constant'
. ' to 1 and run `composer update` before running the tests.' . PHP_EOL;
. ' to 1 and run `composer update -W` before running the tests.' . PHP_EOL;
echo 'Once the dependencies are installed, you can run the tests using the Composer-installed'
. ' version of PHPUnit or using a PHPUnit phar file, but the dependencies do need to be'
. ' installed whichever way the tests are run.' . PHP_EOL;
Expand Down Expand Up @@ -157,7 +157,7 @@
$phpunit_polyfills_minimum_version
);
} elseif ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
echo 'Please run `composer update` to install the latest version.' . PHP_EOL;
echo 'Please run `composer update -W` to install the latest version.' . PHP_EOL;
}
exit( 1 );
}
Expand Down

0 comments on commit fe9f6a2

Please sign in to comment.