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

Add tests for #2723

This commit is contained in:
Marcus Bointon 2022-06-29 11:04:13 +02:00
parent 95f76e7588
commit a4d8cf15ce
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24

View File

@ -741,13 +741,15 @@ EOT;
/**
* Test addressing.
*/
public function testAddressing()
public function testAddressing()
{
self::assertFalse($this->Mail->addAddress(''), 'Empty address accepted');
self::assertFalse($this->Mail->addAddress('', 'Nobody'), 'Empty address with name accepted');
self::assertFalse($this->Mail->addAddress('a@example..com'), 'Invalid address accepted');
self::assertTrue($this->Mail->addAddress('a@example.com'), 'Addressing failed');
self::assertTrue($this->Mail->addAddress('nullname@example.com', null), 'Null name not ignored');
self::assertTrue($this->Mail->addAddress('objectname@example.com', new \stdClass()), 'Object as name not ignored');
self::assertTrue($this->Mail->addAddress('arrayname@example.com', [1,2,3]),'Array as name not ignored');
self::assertFalse($this->Mail->addAddress('a@example.com'), 'Duplicate addressing failed');
self::assertTrue($this->Mail->addCC('b@example.com'), 'CC addressing failed');
self::assertFalse($this->Mail->addCC('b@example.com'), 'CC duplicate addressing failed');
@ -1053,6 +1055,7 @@ EOT;
$this->Mail->isSendmail();
$this->Mail->isQmail();
$this->Mail->Sender = '';
self::assertEmpty($this->Mail->Sender);
$this->Mail->createHeader();
}