Changeset 60240 for trunk/tests/phpunit/tests/user/retrievePassword.php
- Timestamp:
- 05/17/2025 01:29:20 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/retrievePassword.php
r59312 r60240 88 88 $this->assertWPError( retrieve_password() ); 89 89 } 90 91 /** 92 * Tests that a fatal error is not thrown when the login passed via `$_POST` 93 * is an array instead of a string. 94 * 95 * The message that we should not see: 96 * `TypeError: trim(): Argument #1 ($string) must be of type string, array given`. 97 * 98 * @ticket 62794 99 */ 100 public function test_retrieve_password_does_not_throw_fatal_error_with_array_parameters() { 101 $_POST['user_login'] = array( 'example' ); 102 103 $error = retrieve_password(); 104 $this->assertWPError( $error, 'The result should be an instance of WP_Error.' ); 105 106 $error_codes = $error->get_error_codes(); 107 $this->assertContains( 'empty_username', $error_codes, 'The "empty_username" error code should be present.' ); 108 } 90 109 }
Note: See TracChangeset
for help on using the changeset viewer.