Alex\MailCatcher\Tests\MessagePartTest::testMultiPartWithAMimeFormatWarningMessage PHP Method

testMultiPartWithAMimeFormatWarningMessage() public method

    public function testMultiPartWithAMimeFormatWarningMessage()
    {
        $message = <<<EOF
To: [email protected]
From: [email protected]
Subject: Testing file attachments
Date: Mon, 02 Dec 2013 13:40:48 +0000
Content-Type: multipart/mixed;
 boundary="=_dba29f3ae3414895d994f90b8b013498"
MIME-Version: 1.0

This is a message in Mime Format.  If you see this, your mail reader does not support this format.

--=_dba29f3ae3414895d994f90b8b013498
Content-Type: multipart/alternative;
 boundary="=_6d8e9e6de65fe1320ba67bf1757d7c85"
Content-Transfer-Encoding: 8bit


--=_6d8e9e6de65fe1320ba67bf1757d7c85
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Hi, there's a nice file attached to this.=0D=0A=0D=0AWe sent this messag=
e using Lamplight -   click here to unsubscribe.

--=_6d8e9e6de65fe1320ba67bf1757d7c85
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

Hi, there's a nice file attached to this.<br/><br/><span style="font-size:10px; margin-top: 80px; color:#333;">We sent this message using <a href="http://www.lamplightdb.co.uk" title="Lamplight home page" style="text-decoration:none; color:#333;">Lamplight</a> -  <a href="http://lamplight/en/public/unsubscribe/b/-1/c/2/j/1/p/4a704ccecf4a3335aab6fca48eca00cb6c01909ba6fd37ad1ecf2f24457ef289" title="click here to unsubscribe"  style="text-decoration:underline;"> click here to unsubscribe</a>.</span>

--=_6d8e9e6de65fe1320ba67bf1757d7c85--

--=_dba29f3ae3414895d994f90b8b013498
Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testupload.txt"

aGVsbG8sIHRoaXMgaXMgYSBuaWNlIHRleHQgZmlsZSB0byB1cGxvYWQK
--=_dba29f3ae3414895d994f90b8b013498--
EOF;
        $part = new Part();
        $part->loadSource($message);
        $this->assertContains('nice file attached', $part->getPart('text/plain')->getContent(), 'Can we extract the plain text section?');
    }