From 2f39fe479f5ce29754b75e023ace000854ae48d2 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Mon, 27 Mar 2017 21:04:06 +0000 Subject: [PATCH] Tests: Consolidate logic used to skip API fixture generation. This checks for `is_multisite()` and the minimum PHP version in the same block and removes two `echo` statements previously used to indicate generation had been skipped. Fixes #40041. git-svn-id: https://develop.svn.wordpress.org/trunk@40341 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/rest-api/rest-schema-setup.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/rest-api/rest-schema-setup.php b/tests/phpunit/tests/rest-api/rest-schema-setup.php index eea2224331..360a075c8e 100644 --- a/tests/phpunit/tests/rest-api/rest-schema-setup.php +++ b/tests/phpunit/tests/rest-api/rest-schema-setup.php @@ -293,11 +293,8 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase { } } - 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 { + // 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_put_contents( $file, $mocked_responses );