public function testMailHeaderFolding76Char()
{
$mail = new ezcMail();
$mail->from = new ezcMailAddress('*****@*****.**', 'John Doe');
$mail->addTo(new ezcMailAddress('*****@*****.**', 'John Doe'));
$mail->body = new ezcMailText('Text');
// test some subject sizes
for ($i = 1; $i < 300; $i++) {
$mail->subject = str_repeat('1', $i);
$source = $mail->generate();
preg_match('/Subject:\\s[0-9]+/', $source, $matches);
$this->assertEquals(1, count($matches), "Subject is folded incorrectly for length {$i}.");
}
}