WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/16/2017 11:29:16 PM (2 years ago)
Author:
jnylen0
Message:

REST API: Fix the client test fixture generation in PHP 5.2 and 5.3.

Remove JSON_UNESCAPED_SLASHES from the wp_json_encode call - this constant is not supported in PHP < 5.4, and we don't polyfill it either.

Also make the PHPUnit test suite correctly exit with a non-zero exit code when wp-tests-config.php is not present. This was causing grunt restapi-jsclient to incorrectly proceed to its second step even when the first step failed with this error.

Props ocean90.
Fixes #39264.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/includes/bootstrap.php

    r39086 r40065  
    1919global $wpdb, $current_site, $current_blog, $wp_rewrite, $shortcode_tags, $wp, $phpmailer, $wp_theme_directories;
    2020
    21 if ( !is_readable( $config_file_path ) ) {
    22     die( "ERROR: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n" );
     21if ( ! is_readable( $config_file_path ) ) {
     22    echo "ERROR: wp-tests-config.php is missing! Please use wp-tests-config-sample.php to create a config file.\n";
     23    exit( 1 );
    2324}
    2425require_once $config_file_path;
Note: See TracChangeset for help on using the changeset viewer.