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
This commit is contained in:
Jeremy Felt 2017-03-27 21:04:06 +00:00
parent ab57ab8e7f
commit 2f39fe479f

View File

@ -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 );