Make WordPress Core


Ignore:
Timestamp:
02/25/2018 06:06:49 PM (7 years ago)
Author:
adamsilverstein
Message:

Unit Tests: add a DIR_TESTROOT constant to avoid relative paths.

Fix an issue that prevents tests from running correctly when run outside their normal context.

Props PressLabs, johnbillion.
Fixes #40071.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r42724 r42741  
    396396        if ( ! is_multisite() && version_compare( PHP_VERSION, '5.4', '>=' ) ) {
    397397            // Save the route object for QUnit tests.
    398             $file = './tests/qunit/fixtures/wp-api-generated.js';
     398            $file = dirname( DIR_TESTROOT ) . '/qunit/fixtures/wp-api-generated.js';
    399399            file_put_contents( $file, $mocked_responses );
    400400        }
Note: See TracChangeset for help on using the changeset viewer.