WordPress.org

Make WordPress Core

Changeset 40341


Ignore:
Timestamp:
03/27/17 21:04:06 (5 weeks ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r40104 r40341  
    294294        } 
    295295 
    296         if ( is_multisite() ) { 
    297             echo "Skipping generation of API client fixtures in multisite mode.\n"; 
    298         } else if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { 
    299             echo "Skipping generation of API client fixtures due to unsupported JSON_* constants.\n"; 
    300         } else { 
     296        // Only generate API client fixtures in single site and when required JSON_* constants are supported. 
     297        if ( ! is_multisite() && version_compare( PHP_VERSION, '5.4', '>=' ) ) { 
    301298            // Save the route object for QUnit tests. 
    302299            $file = './tests/qunit/fixtures/wp-api-generated.js'; 
Note: See TracChangeset for help on using the changeset viewer.