mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@42741 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user