Ticket #39854: 39854.5.patch
File 39854.5.patch, 2.0 KB (added by , 8 years ago) |
---|
-
src/wp-includes/rest-api/class-wp-rest-server.php
diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index 4f5ae76..9d4a5fe 100644
a b class WP_REST_Server { 1012 1012 public function get_index( $request ) { 1013 1013 // General site data. 1014 1014 $available = array( 1015 'name' => get_option( 'blogname' ), 1016 'description' => get_option( 'blogdescription' ), 1017 'url' => get_option( 'siteurl' ), 1018 'home' => home_url(), 1019 'namespaces' => array_keys( $this->namespaces ), 1020 'authentication' => array(), 1021 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), 1015 'name' => get_option( 'blogname' ), 1016 'description' => get_option( 'blogdescription' ), 1017 'url' => get_option( 'siteurl' ), 1018 'home' => home_url(), 1019 'gmt_offset' => get_option( 'gmt_offset' ), 1020 'timezone_string' => get_option( 'timezone_string' ), 1021 'namespaces' => array_keys( $this->namespaces ), 1022 'authentication' => array(), 1023 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), 1022 1024 ); 1023 1025 1024 1026 $response = new WP_REST_Response( $available ); -
tests/phpunit/tests/rest-api/rest-server.php
diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php index cda4a4f..046d2b5 100644
a b class Tests_REST_Server extends WP_Test_REST_TestCase { 646 646 $this->assertArrayHasKey( 'description', $data ); 647 647 $this->assertArrayHasKey( 'url', $data ); 648 648 $this->assertArrayHasKey( 'home', $data ); 649 $this->assertArrayHasKey( 'gmt_offset', $data ); 650 $this->assertArrayHasKey( 'timezone_string', $data ); 649 651 $this->assertArrayHasKey( 'namespaces', $data ); 650 652 $this->assertArrayHasKey( 'authentication', $data ); 651 653 $this->assertArrayHasKey( 'routes', $data );