ÿØÿà JFIF ÿá Exif MM * ÿÛ C
Server IP : 199.250.214.225 / Your IP : 3.145.70.11 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/acceptance/Swift/Mime/ |
Upload File : |
<?php use Egulias\EmailValidator\EmailValidator; class Swift_Mime_MimePartAcceptanceTest extends \PHPUnit\Framework\TestCase { private $contentEncoder; private $cache; private $headers; private $emailValidator; protected function setUp() { $this->cache = new Swift_KeyCache_ArrayKeyCache( new Swift_KeyCache_SimpleKeyCacheInputStream() ); $factory = new Swift_CharacterReaderFactory_SimpleCharacterReaderFactory(); $this->contentEncoder = new Swift_Mime_ContentEncoder_QpContentEncoder( new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8'), new Swift_StreamFilters_ByteArrayReplacementFilter( [[0x0D, 0x0A], [0x0D], [0x0A]], [[0x0A], [0x0A], [0x0D, 0x0A]] ) ); $headerEncoder = new Swift_Mime_HeaderEncoder_QpHeaderEncoder( new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') ); $paramEncoder = new Swift_Encoder_Rfc2231Encoder( new Swift_CharacterStream_ArrayCharacterStream($factory, 'utf-8') ); $this->emailValidator = new EmailValidator(); $this->idGenerator = new Swift_Mime_IdGenerator('example.com'); $this->headers = new Swift_Mime_SimpleHeaderSet( new Swift_Mime_SimpleHeaderFactory($headerEncoder, $paramEncoder, $this->emailValidator) ); } public function testCharsetIsSetInHeader() { $part = $this->createMimePart(); $part->setContentType('text/plain'); $part->setCharset('utf-8'); $part->setBody('foobar'); $this->assertEquals( 'Content-Type: text/plain; charset=utf-8'."\r\n". 'Content-Transfer-Encoding: quoted-printable'."\r\n". "\r\n". 'foobar', $part->toString() ); } public function testFormatIsSetInHeaders() { $part = $this->createMimePart(); $part->setContentType('text/plain'); $part->setFormat('flowed'); $part->setBody('> foobar'); $this->assertEquals( 'Content-Type: text/plain; format=flowed'."\r\n". 'Content-Transfer-Encoding: quoted-printable'."\r\n". "\r\n". '> foobar', $part->toString() ); } public function testDelSpIsSetInHeaders() { $part = $this->createMimePart(); $part->setContentType('text/plain'); $part->setDelSp(true); $part->setBody('foobar'); $this->assertEquals( 'Content-Type: text/plain; delsp=yes'."\r\n". 'Content-Transfer-Encoding: quoted-printable'."\r\n". "\r\n". 'foobar', $part->toString() ); } public function testAll3ParamsInHeaders() { $part = $this->createMimePart(); $part->setContentType('text/plain'); $part->setCharset('utf-8'); $part->setFormat('fixed'); $part->setDelSp(true); $part->setBody('foobar'); $this->assertEquals( 'Content-Type: text/plain; charset=utf-8; format=fixed; delsp=yes'."\r\n". 'Content-Transfer-Encoding: quoted-printable'."\r\n". "\r\n". 'foobar', $part->toString() ); } public function testBodyIsCanonicalized() { $part = $this->createMimePart(); $part->setContentType('text/plain'); $part->setCharset('utf-8'); $part->setBody("foobar\r\rtest\ning\r"); $this->assertEquals( 'Content-Type: text/plain; charset=utf-8'."\r\n". 'Content-Transfer-Encoding: quoted-printable'."\r\n". "\r\n". "foobar\r\n". "\r\n". "test\r\n". "ing\r\n", $part->toString() ); } protected function createMimePart() { $entity = new Swift_Mime_MimePart( $this->headers, $this->contentEncoder, $this->cache, $this->idGenerator ); return $entity; } }