Embeds: Replace hardcoded error messages with get_status_header_desc( $http_code ).

Fixes #34275.

git-svn-id: https://develop.svn.wordpress.org/trunk@35408 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2015-10-27 20:43:00 +00:00
parent 1353016c4f
commit 88cdbb6a49
2 changed files with 10 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
$legacy_controller = new WP_oEmbed_Controller();
$this->assertEquals( 'Invalid URL.', $legacy_controller->dispatch( $request ) );
$this->assertEquals( get_status_header_desc( 404 ), $legacy_controller->dispatch( $request ) );
}
function test_request_json() {
@@ -27,7 +27,7 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
// WP_Query arguments.
$request = array(
'url' => get_permalink( $post->ID ),
'url' => get_permalink( $post->ID ),
'format' => 'json',
'maxwidth' => 400,
'callback' => '',
@@ -69,7 +69,7 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
) );
$request = array(
'url' => get_permalink( $post->ID ),
'url' => get_permalink( $post->ID ),
'format' => 'json',
'maxwidth' => 600,
'callback' => 'mycallback',
@@ -92,7 +92,7 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
) );
$request = array(
'url' => get_permalink( $post->ID ),
'url' => get_permalink( $post->ID ),
'format' => 'json',
'maxwidth' => 600,
'callback' => array( 'foo', 'bar' ),
@@ -112,9 +112,9 @@ class Test_oEmbed_Controller extends WP_UnitTestCase {
$legacy_controller = new WP_oEmbed_Controller();
$this->assertEquals( 'Not implemented', $legacy_controller->json_response( null, $request ) );
$this->assertEquals( 'Not implemented', $legacy_controller->json_response( 123, $request ) );
$this->assertEquals( 'Not implemented', $legacy_controller->json_response( array(), $request ) );
$this->assertEquals( get_status_header_desc( 501 ), $legacy_controller->json_response( null, $request ) );
$this->assertEquals( get_status_header_desc( 501 ), $legacy_controller->json_response( 123, $request ) );
$this->assertEquals( get_status_header_desc( 501 ), $legacy_controller->json_response( array(), $request ) );
}
function test_request_xml() {