diff --git a/tests/phpunit/tests/mail.php b/tests/phpunit/tests/pluggable/wpMail.php similarity index 99% rename from tests/phpunit/tests/mail.php rename to tests/phpunit/tests/pluggable/wpMail.php index 53eacbd7f5..bbe27bd88e 100644 --- a/tests/phpunit/tests/mail.php +++ b/tests/phpunit/tests/pluggable/wpMail.php @@ -2,8 +2,10 @@ /** * @group pluggable * @group mail + * + * @covers ::wp_mail */ -class Tests_Mail extends WP_UnitTestCase { +class Tests_Pluggable_wpMail extends WP_UnitTestCase { public function set_up() { parent::set_up(); reset_phpmailer_instance(); @@ -478,17 +480,18 @@ class Tests_Mail extends WP_UnitTestCase { /** * Tests that AltBody is reset between each wp_mail call. - * - * @covers :wp_mail */ public function test_wp_mail_resets_properties() { $wp_mail_set_text_message = function ( $phpmailer ) { $phpmailer->AltBody = 'user1'; }; + add_action( 'phpmailer_init', $wp_mail_set_text_message ); wp_mail( 'user1@example.localhost', 'Test 1', '
demo
', 'Content-Type: text/html' ); remove_action( 'phpmailer_init', $wp_mail_set_text_message ); + wp_mail( 'user2@example.localhost', 'Test 2', 'test2' ); + $phpmailer = $GLOBALS['phpmailer']; $this->assertNotSame( 'user1', $phpmailer->AltBody ); } diff --git a/tests/phpunit/tests/pluggable/wpRand.php b/tests/phpunit/tests/pluggable/wpRand.php index e7ef3b2725..9fcfa8bde1 100644 --- a/tests/phpunit/tests/pluggable/wpRand.php +++ b/tests/phpunit/tests/pluggable/wpRand.php @@ -2,6 +2,7 @@ /** * @group pluggable + * * @covers ::wp_rand */ class Tests_Pluggable_wpRand extends WP_UnitTestCase {