WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/20/2021 04:44:00 PM (3 months ago)
Author:
hellofromTonya
Message:

Build/Test Tools: Improve Composer update command in bootstrap error 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/bootstrap.php

    r51813 r51828  
    6767 *
    6868 * Plugin/theme integration tests can handle this in any of the following ways:
    69  * - When using a full WP install: run `composer update` for the WP install prior to running the tests.
     69 * - When using a full WP install: run `composer update -W` for the WP install prior to running the tests.
    7070 * - When using a partial WP test suite install:
    7171 *   - Add a `yoast/phpunit-polyfills` (dev) requirement to the plugin/theme's own `composer.json` file.
     
    113113                . ' of the PHPUnit Polyfills library.' . PHP_EOL;
    114114        } elseif ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
    115             echo 'You need to run `composer update` before running the tests.' . PHP_EOL;
     115            echo 'You need to run `composer update -W` before running the tests.' . PHP_EOL;
    116116            echo 'Once the dependencies are installed, you can run the tests using the Composer-installed version'
    117117                . ' of PHPUnit or using a PHPUnit phar file, but the dependencies do need to be installed'
     
    124124                . ' constant to allow the WP Core bootstrap to load the Polyfills.' . PHP_EOL . PHP_EOL;
    125125            echo 'If you are trying to run the WP Core tests, make sure to set the "WP_RUN_CORE_TESTS" constant'
    126                 . ' to 1 and run `composer update` before running the tests.' . PHP_EOL;
     126                . ' to 1 and run `composer update -W` before running the tests.' . PHP_EOL;
    127127            echo 'Once the dependencies are installed, you can run the tests using the Composer-installed'
    128128                . ' version of PHPUnit or using a PHPUnit phar file, but the dependencies do need to be'
     
    158158        );
    159159    } elseif ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
    160         echo 'Please run `composer update` to install the latest version.' . PHP_EOL;
     160        echo 'Please run `composer update -W` to install the latest version.' . PHP_EOL;
    161161    }
    162162    exit( 1 );
Note: See TracChangeset for help on using the changeset viewer.