Changeset 47279 for trunk/tests/phpunit/tests/user/wpSendUserRequest.php
- Timestamp:
- 02/11/2020 09:41:26 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/wpSendUserRequest.php
r46586 r47279 230 230 231 231 /** 232 * The email headers should be filterable. 233 * 234 * @since 5.4.0 235 * 236 * @ticket 44501 237 */ 238 public function test_email_headers_should_be_filterable() { 239 $request_id = wp_create_user_request( self::$test_user->user_email, 'remove_personal_data' ); 240 241 add_filter( 'user_request_action_email_headers', array( $this, 'modify_email_headers' ) ); 242 $result = wp_send_user_request( $request_id ); 243 244 $mailer = tests_retrieve_phpmailer_instance(); 245 246 $this->assertContains( 'From: Tester <tester@example.com>', $mailer->get_sent()->header ); 247 } 248 249 /** 250 * Filter callback to modify the headers of the email sent when an account action is attempted. 251 * 252 * @since 5.4.0 253 * 254 * @param string|array $headers The email headers. 255 * @return array $headers The new email headers. 256 */ 257 public function modify_email_headers( $headers ) { 258 $headers = array( 259 'From: Tester <tester@example.com>', 260 ); 261 262 return $headers; 263 } 264 265 /** 232 266 * The function should error when the email was not sent. 233 267 *
Note: See TracChangeset
for help on using the changeset viewer.