WordPress.org

Make WordPress Core

Changeset 43311


Ignore:
Timestamp:
05/23/2018 05:54:44 PM (13 months ago)
Author:
johnbillion
Message:

Build/Test Tools: Roses are red, this fixes stuff.

Update the test infrastructure so that third party plugins, themes, and projects that use the core testing framework continue to operate from the src directory and do not require a build step.

Props mboynes, danielbachhuber, schlessera

See #43055

Location:
trunk
Files:
2 edited

Legend:

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

    r43309 r43311  
    3333require_once dirname( __FILE__ ) . '/functions.php';
    3434
    35 if ( file_exists( ABSPATH . '_index.php' ) ) {
     35if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && file_exists( ABSPATH . '_index.php' ) ) {
    3636    // Perhaps add more documentation about having to run `grunt` before running tests after changing code.
    3737    echo "ERROR: ABSPATH must point to the `build` directory, not the `src` directory. Please update your wp-tests-config.php file.\n";
  • trunk/wp-tests-config-sample.php

    r43309 r43311  
    22
    33/* Path to the WordPress codebase you'd like to test. Add a forward slash in the end. */
    4 define( 'ABSPATH', dirname( __FILE__ ) . '/build/' );
     4if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS ) {
     5    define( 'ABSPATH', dirname( __FILE__ ) . '/build/' );
     6} else {
     7    define( 'ABSPATH', dirname( __FILE__ ) . '/src/' );
     8}
    59
    610/*
Note: See TracChangeset for help on using the changeset viewer.