Changeset 47326
- Timestamp:
- 02/20/2020 12:53:43 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r47260 r47326 1289 1289 if ( strpos( $route, '{' ) === false ) { 1290 1290 $data['_links'] = array( 1291 'self' => rest_url( $route ), 1291 'self' => array( 1292 array( 1293 'href' => rest_url( $route ), 1294 ), 1295 ), 1292 1296 ); 1293 1297 } -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r47260 r47326 1019 1019 $this->assertContains( 'test/example', $namespaces ); 1020 1020 $this->assertContains( 'test/another', $namespaces ); 1021 } 1022 1023 /** 1024 * @ticket 49147 1025 */ 1026 public function test_get_data_for_non_variable_route_includes_links() { 1027 $expected = array( 1028 'self' => array( 1029 array( 'href' => rest_url( 'wp/v2/posts' ) ), 1030 ), 1031 ); 1032 1033 $actual = rest_get_server()->get_data_for_route( 1034 '/wp/v2/posts', 1035 array( 1036 array( 1037 'methods' => array( 'OPTIONS' => 1 ), 1038 'show_in_index' => true, 1039 ), 1040 ) 1041 ); 1042 1043 $this->assertEquals( $expected, $actual['_links'] ); 1021 1044 } 1022 1045
Note: See TracChangeset
for help on using the changeset viewer.