public function testEncodingAsciiCharactersProducesValidToken() { $string = '';
foreach (range(0x00, 0x7F
) as $octet) { $char =
pack('C',
$octet);
$string .=
$char;
} $encoder =
new Rfc2231Encoder();
$encoded =
$encoder->
encodeString($string);
foreach (explode("\r\n",
$encoded) as $line) { $this->
assertMatchesRegularExpression($this->rfc2045Token,
$line, 'Encoder should always return a valid RFC 2045 token.'
);
} } public function testEncodingNonAsciiCharactersProducesValidToken() { $string = '';
foreach (range(0x80, 0xFF
) as $octet) {