diff --git a/tests/phpunit/includes/bootstrap.php b/tests/phpunit/includes/bootstrap.php index 41f8ea6a2c..460d5fbeba 100644 --- a/tests/phpunit/includes/bootstrap.php +++ b/tests/phpunit/includes/bootstrap.php @@ -36,6 +36,7 @@ tests_reset__SERVER(); define( 'WP_TESTS_TABLE_PREFIX', $table_prefix ); define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' ); +define( 'DIR_TESTROOT', realpath( dirname( dirname( __FILE__ ) ) ) ); define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' ); diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index 2159cde0d4..e5b3460122 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -395,7 +395,7 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { // Only generate API client fixtures in single site and when required JSON_* constants are supported. if ( ! is_multisite() && version_compare( PHP_VERSION, '5.4', '>=' ) ) { // Save the route object for QUnit tests. - $file = './tests/qunit/fixtures/wp-api-generated.js'; + $file = dirname( DIR_TESTROOT ) . '/qunit/fixtures/wp-api-generated.js'; file_put_contents( $file, $mocked_responses ); }