From 127f243bfe47204bf0a8c9fb245b159fe63e6669 Mon Sep 17 00:00:00 2001 From: jnylen0 Date: Sat, 18 Feb 2017 19:29:24 +0000 Subject: [PATCH] REST API: Skip generating the client test fixtures in multisite mode. There are a couple of changes to the generated API schemas between single-site and multisite mode - for example, the `url` and `email` settings are not present in the settings endpoint (see #39005). To avoid unexpected changes to the `wp-api-generated.js` fixture file, skip generating the client test fixtures when running the test suite in multisite mode. See #39264. git-svn-id: https://develop.svn.wordpress.org/trunk@40077 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-schema-setup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index 80712ce172..c286504e18 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -283,7 +283,9 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { } } - if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { + if ( is_multisite() ) { + echo "Skipping generation of API client fixtures in multisite mode.\n"; + } else if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { echo "Skipping generation of API client fixtures due to unsupported JSON_* constants.\n"; } else { // Save the route object for QUnit tests.