Merge pull request #4230 from dokuwiki-translate/lang_update_830_1709550808
[dokuwiki.git] / _test / tests / inc / mail_quoted_printable_encode.test.php
blob5788032920a4ce2d95d0289fd516f759c19be139
1 <?php
3 class mail_quotedprintable_encode extends DokuWikiTest {
5 function test_simple(){
6 $in = 'hello';
7 $out = 'hello';
8 $this->assertEquals(mail_quotedprintable_encode($in),$out);
11 function test_spaceend(){
12 $in = "hello \nhello";
13 $out = "hello=20\r\nhello";
14 $this->assertEquals(mail_quotedprintable_encode($in),$out);
17 function test_german_utf8(){
18 $in = 'hello überlänge';
19 $out = 'hello =C3=BCberl=C3=A4nge';
20 $this->assertEquals(mail_quotedprintable_encode($in),$out);
23 function test_wrap(){
24 $in = '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
25 $out = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234=\r\n56789 123456789";
26 $this->assertEquals(mail_quotedprintable_encode($in,74),$out);
29 function test_nowrap(){
30 $in = '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
31 $out = '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
32 $this->assertEquals(mail_quotedprintable_encode($in,0),$out);
35 function test_russian_utf8(){
36 $in = 'Ваш пароль для системы Доку Вики';
37 $out = '=D0=92=D0=B0=D1=88 =D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8C =D0=B4=D0=BB=D1=8F =D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC=D1=8B =D0=94=D0=BE=D0=BA=D1=83 =D0=92=D0=B8=D0=BA=D0=B8';
38 $this->assertEquals(mail_quotedprintable_encode($in,0),$out);
42 //Setup VIM: ex: et ts=4 :