Changeset 35408
- Timestamp:
- 10/27/2015 08:43:00 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-oembed-controller.php
r35354 r35408 33 33 if ( false === $wp_query->get( 'url', false ) ) { 34 34 status_header( 400 ); 35 echo 'URL parameter missing';35 return get_status_header_desc( 400 ); 36 36 exit; 37 37 } … … 89 89 if ( false === $data ) { 90 90 status_header( 404 ); 91 return __( 'Invalid URL.');91 return get_status_header_desc( 404 ); 92 92 } 93 93 … … 118 118 if ( ! $result || ! is_array( $data ) || empty( $data ) ) { 119 119 status_header( 501 ); 120 return 'Not implemented';120 return get_status_header_desc( 501 ); 121 121 } 122 122 -
trunk/tests/phpunit/tests/oembed/controller.php
r35354 r35408 14 14 $legacy_controller = new WP_oEmbed_Controller(); 15 15 16 $this->assertEquals( 'Invalid URL.', $legacy_controller->dispatch( $request ) );16 $this->assertEquals( get_status_header_desc( 404 ), $legacy_controller->dispatch( $request ) ); 17 17 } 18 18 … … 28 28 // WP_Query arguments. 29 29 $request = array( 30 'url' 30 'url' => get_permalink( $post->ID ), 31 31 'format' => 'json', 32 32 'maxwidth' => 400, … … 70 70 71 71 $request = array( 72 'url' 72 'url' => get_permalink( $post->ID ), 73 73 'format' => 'json', 74 74 'maxwidth' => 600, … … 93 93 94 94 $request = array( 95 'url' 95 'url' => get_permalink( $post->ID ), 96 96 'format' => 'json', 97 97 'maxwidth' => 600, … … 113 113 $legacy_controller = new WP_oEmbed_Controller(); 114 114 115 $this->assertEquals( 'Not implemented',$legacy_controller->json_response( null, $request ) );116 $this->assertEquals( 'Not implemented',$legacy_controller->json_response( 123, $request ) );117 $this->assertEquals( 'Not implemented',$legacy_controller->json_response( array(), $request ) );115 $this->assertEquals( get_status_header_desc( 501 ), $legacy_controller->json_response( null, $request ) ); 116 $this->assertEquals( get_status_header_desc( 501 ), $legacy_controller->json_response( 123, $request ) ); 117 $this->assertEquals( get_status_header_desc( 501 ), $legacy_controller->json_response( array(), $request ) ); 118 118 } 119 119
Note: See TracChangeset
for help on using the changeset viewer.