Changeset 41170 for trunk/tests/phpunit/tests/user/multisite.php
- Timestamp:
- 07/27/2017 02:33:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/multisite.php
r40632 r41170 454 454 $this->assertContains( '\'Test\' site\'s "name" has <html entities> &', $email->body, 'Email body does not contain the decoded HTML entities' ); 455 455 $this->assertNotContains( ''Test' site's "name" has <html entities> &', 'Email body does contains HTML entities' ); 456 $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email bodydoes not contain the decoded HTML entities' );456 $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email subject does not contain the decoded HTML entities' ); 457 457 $this->assertNotContains( ''Test' blog's "name" has <html entities> &', $email->subject, $email->subject, 'Email subject does contains HTML entities' ); 458 458 } 459 459 460 460 /** 461 * A notification e-mail should not be sent if the new admin e-mail:462 * - Matches the eexisting admin email, or463 * - is not a valid e -mail, or461 * A confirmation email should not be sent if the new admin email: 462 * - Matches the existing admin email, or 463 * - is not a valid email 464 464 * 465 * @dataProvider data_user_admin_email_ notification_emails466 */ 467 function test_ms_new_admin_email_ notification_not_sent_when_email_invalid( $email, $message ) {465 * @dataProvider data_user_admin_email_confirmation_emails 466 */ 467 function test_ms_new_admin_email_confirmation_not_sent_when_email_invalid( $email, $message ) { 468 468 reset_phpmailer_instance(); 469 469 470 update_option( 'admin_email', 'existing-email@test.dev' ); 471 update_option_new_admin_email( 'existing-email@test.dev', $email ); 470 update_option_new_admin_email( get_option( 'admin_email' ), $email ); 472 471 473 472 $mailer = tests_retrieve_phpmailer_instance(); … … 477 476 478 477 /** 479 * Data provider for test_ms_new_admin_email_ notification_not_sent_when_email_invalid().478 * Data provider for test_ms_new_admin_email_confirmation_not_sent_when_email_invalid(). 480 479 * 481 480 * @return array { 482 481 * @type array { 483 * @type string $email The new e -mail for admin_email482 * @type string $email The new email for admin_email 484 483 * @type string $message An error message to display if the test fails 485 484 * } 486 485 * } 487 486 */ 488 function data_user_admin_email_ notification_emails() {487 function data_user_admin_email_confirmation_emails() { 489 488 return array( 490 489 array( 491 'existing-email@test.dev',492 'A notification e-mail should not be sent if the current admin e-mail matches the new e-mail',490 get_option( 'admin_email' ), 491 'A confirmation email should not be sent if the current admin email matches the new email', 493 492 ), 494 493 array( 495 494 'not an email', 496 'A notification e-mail should not be sent if it is not a valid e-mail',495 'A confirmation email should not be sent if it is not a valid email', 497 496 ) 498 497 ); … … 534 533 $this->assertContains( '\'Test\' site\'s "name" has <html entities> &', $email->body, 'Email body does not contain the decoded HTML entities' ); 535 534 $this->assertNotContains( ''Test' site's "name" has <html entities> &', $email->body, 'Email body does contains HTML entities' ); 536 $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email bodydoes not contain the decoded HTML entities' );535 $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email subject does not contain the decoded HTML entities' ); 537 536 $this->assertNotContains( ''Test' blog's "name" has <html entities> &', $email->subject, 'Email subject does contains HTML entities' ); 538 537
Note: See TracChangeset
for help on using the changeset viewer.