Ticket #48074: 48074.4.patch
File 48074.4.patch, 1.2 KB (added by , 5 years ago) |
---|
-
phpunit/tests/rest-api/rest-schema-setup.php
449 449 ); 450 450 $this->assertTrue( ! empty( $data ), $route['name'] . ' route should return data.' ); 451 451 452 if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) { 453 $fixture = $this->normalize_fixture( $data, $route['name'] ); 454 $mocked_responses .= "\nmockedApiResponse." . $route['name'] . ' = ' 452 $fixture = $this->normalize_fixture( $data, $route['name'] ); 453 $mocked_responses .= "\nmockedApiResponse." . $route['name'] . ' = ' 455 454 . json_encode( $fixture, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) 456 455 . ";\n"; 457 } 456 458 457 } 459 458 460 459 // Only generate API client fixtures in single site and when required JSON_* constants are supported. 461 if ( ! is_multisite() && version_compare( PHP_VERSION, '5.4', '>=' )) {460 if ( ! is_multisite() ) { 462 461 // Save the route object for QUnit tests. 463 462 $file = dirname( DIR_TESTROOT ) . '/qunit/fixtures/wp-api-generated.js'; 464 463 file_put_contents( $file, $mocked_responses );