WordPress.org

Make WordPress Core

Ticket #43055: 43055.12.diff

File 43055.12.diff, 1.3 KB (added by danielbachhuber, 4 weeks ago)
  • tests/phpunit/includes/bootstrap.php

    diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php
    index f924a7dc03..eccf49354f 100644
    a b if ( ! is_readable( $config_file_path ) ) { 
    3232require_once $config_file_path;
    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";
    3838        exit( 1 );
  • wp-tests-config-sample.php

    diff --git a/wp-tests-config-sample.php b/wp-tests-config-sample.php
    index fd1ccd0d61..083d6b3efd 100644
    a b  
    11<?php
    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 ( is_dir( dirname( __FILE__ ) . '/build/' ) ) {
     5        define( 'ABSPATH', dirname( __FILE__ ) . '/build/' );
     6} else {
     7        define( 'ABSPATH', dirname( __FILE__ ) . '/src/' );
     8}
    59
    610/*
    711 * Path to the theme to test with.