$this->
expectException(\TypeError::
class);
new TextPart(new \
stdClass());
} public function testHeaders() { $p =
new TextPart('content'
);
$this->
assertEquals(new Headers( new ParameterizedHeader('Content-Type', 'text/plain',
['charset' => 'utf-8'
]),
new UnstructuredHeader('Content-Transfer-Encoding', 'quoted-printable'
) ),
$p->
getPreparedHeaders());
$p =
new TextPart('content', 'iso-8859-1'
);
$this->
assertEquals(new Headers( new ParameterizedHeader('Content-Type', 'text/plain',
['charset' => 'iso-8859-1'
]),
new UnstructuredHeader('Content-Transfer-Encoding', 'quoted-printable'
) ),
$p->
getPreparedHeaders());
} public function testEncoding() { $p =
new TextPart('content', 'utf-8', 'plain', 'base64'
);