Changeset 41171 for trunk/tests/phpunit/tests/user/multisite.php
- Timestamp:
- 07/27/2017 02:58:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/multisite.php
r41170 r41171 496 496 ) 497 497 ); 498 }499 500 /**501 * Ensure email change confirmation emails do not contain encoded HTML entities502 * @ticket 40015503 */504 function test_ms_send_confirmation_on_profile_email_html_entities_decoded() {505 506 $old_current = get_current_user_id();507 $user_id = self::factory()->user->create( array(508 'role' => 'subscriber',509 'user_email' => 'old-email@test.dev',510 ) );511 wp_set_current_user( $user_id );512 513 reset_phpmailer_instance();514 515 // Give the site and blog a name containing HTML entities516 update_site_option( 'site_name', ''Test' site's "name" has <html entities> &' );517 update_option( 'blogname', ''Test' blog's "name" has <html entities> &' );518 519 // Set $_POST['email'] with new e-mail and $_POST['id'] with user's ID.520 $_POST['user_id'] = $user_id;521 $_POST['email'] = 'new-email@test.dev';522 send_confirmation_on_profile_email( );523 524 $mailer = tests_retrieve_phpmailer_instance();525 526 $recipient = $mailer->get_recipient( 'to' );527 $email = $mailer->get_sent();528 529 // Assert reciepient is correct530 $this->assertSame( 'new-email@test.dev', $recipient->address, 'Admin email change notification recipient not as expected' );531 532 // Assert that HTML entites have been decode in body and subject533 $this->assertContains( '\'Test\' site\'s "name" has <html entities> &', $email->body, 'Email body does not contain the decoded HTML entities' );534 $this->assertNotContains( ''Test' site's "name" has <html entities> &', $email->body, 'Email body does contains HTML entities' );535 $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email subject does not contain the decoded HTML entities' );536 $this->assertNotContains( ''Test' blog's "name" has <html entities> &', $email->subject, 'Email subject does contains HTML entities' );537 538 wp_set_current_user( $old_current );539 498 } 540 499
Note: See TracChangeset
for help on using the changeset viewer.