0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 01:52:15 +02:00

PreSendTestCase: reduce amount of properties being preset

After some investigation, it turns out that barely any of these properties are actually needed for the `PHPMailer::preSend()` method to succeed.

This commit removes all presetting of properties for the PHPMailer instance created by the `PreSendTestCase`, save for the bare minimum.

Overloading and/or adding to the `$propertyChanges` array from concrete test cases is, of course, supported, so if individual tests need additional presetting of properties, the same logic as mentioned in the previous commit can be used.
This commit is contained in:
jrfnl 2021-07-03 05:07:10 +02:00
parent f4bb4d7b63
commit f9ce138ff7

View File

@ -13,7 +13,6 @@
namespace PHPMailer\Test;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\Test\TestCase;
@ -38,26 +37,8 @@ abstract class PreSendTestCase extends TestCase
'SMTPDebug' => SMTP::DEBUG_CONNECTION, // Full debug output.
'Debugoutput' => ['PHPMailer\Test\DebugLogTestListener', 'debugLog'],
'Priority' => 3,
'Encoding' => '8bit',
'CharSet' => PHPMailer::CHARSET_ISO88591,
// Minimal set of properties which are needed for the preSend() command to succeed.
'From' => 'unit_test@phpmailer.example.com',
'FromName' => 'Unit Tester',
'Sender' => 'unit_test@phpmailer.example.com',
'Subject' => 'Unit Test',
'Body' => '',
'AltBody' => '',
'WordWrap' => 0,
'Host' => 'mail.example.com',
'Port' => 25,
'Helo' => 'localhost.localdomain',
'SMTPAuth' => false,
'Username' => '',
'Password' => '',
'ReplyTo' => [
'address' => 'no_reply@phpmailer.example.com',
'name' => 'Reply Guy',
],
'to' => [
'address' => 'somebody@example.com',
'name' => 'Test User',