ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.137.169.129 Web Server : Apache System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : nicngo5 ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /home/nicngo5/laravelvue/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Mime/Headers/ |
Upload File : |
<?php use Egulias\EmailValidator\EmailValidator; class Swift_Mime_Headers_PathHeaderTest extends \PHPUnit\Framework\TestCase { public function testTypeIsPathHeader() { $header = $this->getHeader('Return-Path'); $this->assertEquals(Swift_Mime_Header::TYPE_PATH, $header->getFieldType()); } public function testSingleAddressCanBeSetAndFetched() { $header = $this->getHeader('Return-Path'); $header->setAddress('chris@swiftmailer.org'); $this->assertEquals('chris@swiftmailer.org', $header->getAddress()); } /** * @expectedException \Exception */ public function testAddressMustComplyWithRfc2822() { $header = $this->getHeader('Return-Path'); $header->setAddress('chr is@swiftmailer.org'); } public function testValueIsAngleAddrWithValidAddress() { /* -- RFC 2822, 3.6.7. return = "Return-Path:" path CRLF path = ([CFWS] "<" ([CFWS] / addr-spec) ">" [CFWS]) / obs-path */ $header = $this->getHeader('Return-Path'); $header->setAddress('chris@swiftmailer.org'); $this->assertEquals('<chris@swiftmailer.org>', $header->getFieldBody()); } public function testAddressIsIdnEncoded() { $header = $this->getHeader('Return-Path'); $header->setAddress('chris@swïftmailer.org'); $this->assertEquals('<chris@xn--swftmailer-78a.org>', $header->getFieldBody()); } /** * @expectedException \Swift_AddressEncoderException */ public function testAddressMustBeEncodable() { $header = $this->getHeader('Return-Path'); $header->setAddress('chrïs@swiftmailer.org'); $header->getFieldBody(); } public function testValueIsEmptyAngleBracketsIfEmptyAddressSet() { $header = $this->getHeader('Return-Path'); $header->setAddress(''); $this->assertEquals('<>', $header->getFieldBody()); } public function testSetBodyModel() { $header = $this->getHeader('Return-Path'); $header->setFieldBodyModel('foo@bar.tld'); $this->assertEquals('foo@bar.tld', $header->getAddress()); } public function testGetBodyModel() { $header = $this->getHeader('Return-Path'); $header->setAddress('foo@bar.tld'); $this->assertEquals('foo@bar.tld', $header->getFieldBodyModel()); } public function testToString() { $header = $this->getHeader('Return-Path'); $header->setAddress('chris@swiftmailer.org'); $this->assertEquals('Return-Path: <chris@swiftmailer.org>'."\r\n", $header->toString() ); } private function getHeader($name) { return new Swift_Mime_Headers_PathHeader($name, new EmailValidator(), new Swift_AddressEncoder_IdnAddressEncoder()); } }