diff --git a/src/wp-login.php b/src/wp-login.php
index e02208ae56..363b7bfc32 100644
a
|
b
|
function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { |
38 | 38 | |
39 | 39 | add_action( 'login_head', 'wp_login_viewport_meta' ); |
40 | 40 | |
41 | | if ( empty( $wp_error ) ) { |
| 41 | if ( ! is_wp_error( $wp_error ) ) { |
42 | 42 | $wp_error = new WP_Error(); |
43 | 43 | } |
44 | 44 | |
diff --git a/tests/phpunit/tests/http/getHttpHeaders.php b/tests/phpunit/tests/http/getHttpHeaders.php
index ccb6b4f545..d4a03a82e1 100644
a
|
b
|
class Tests_HTTP_GetHttpHeaders extends WP_UnitTestCase { |
50 | 50 | wp_get_http_headers( 'does_not_matter', $deprecated = true ); |
51 | 51 | } |
52 | 52 | |
| 53 | /** |
| 54 | * Test to check if login_header is getting error argument. |
| 55 | */ |
| 56 | |
| 57 | public function test_wp_get_http_headers_login() { |
| 58 | $result = login_header( 'Log In', '', 'Test.' ); |
| 59 | $this->assertWPError(); |
| 60 | } |
| 61 | |