mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@40065 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -277,7 +277,7 @@ class WP_Test_REST_Schema_Initialization extends WP_Test_REST_TestCase {
|
||||
|
||||
$fixture = $this->normalize_fixture( $data, $route['name'] );
|
||||
$mocked_responses .= "\nmockedApiResponse." . $route['name'] . ' = '
|
||||
. json_encode( $fixture, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES )
|
||||
. json_encode( $fixture, JSON_PRETTY_PRINT )
|
||||
. ";\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user