[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/cases/inc/ -> mail_quoted_printable_encode.php (source)

   1  <?php
   2  
   3  require_once  DOKU_INC.'inc/mail.php';
   4  
   5  class mail_quotedprintable_encode extends UnitTestCase {
   6  
   7      function test_simple(){
   8          $in  = 'hello';
   9          $out = 'hello';
  10          $this->assertEqual(mail_quotedprintable_encode($in),$out);
  11      }
  12  
  13      function test_spaceend(){
  14          $in  = "hello \nhello";
  15          $out = "hello=20\nhello";
  16          $this->assertEqual(mail_quotedprintable_encode($in),$out);
  17      }
  18  
  19      function test_german_utf8(){
  20          $in  = 'hello überlänge';
  21          $out = 'hello =C3=BCberl=C3=A4nge';
  22          $this->assertEqual(mail_quotedprintable_encode($in),$out);
  23      }
  24  
  25      function test_wrap(){
  26          $in  = '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
  27          $out = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 1234=\n56789 123456789";
  28          $this->assertEqual(mail_quotedprintable_encode($in,74),$out);
  29      }
  30  
  31      function test_nowrap(){
  32          $in  = '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
  33          $out = '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789';
  34          $this->assertEqual(mail_quotedprintable_encode($in,0),$out);
  35      }
  36  
  37      function test_russian_utf8(){
  38          $in  = 'Ваш пароль для системы Доку Вики';
  39          $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';
  40          $this->assertEqual(mail_quotedprintable_encode($in,0),$out);
  41      }
  42  }
  43  
  44  //Setup VIM: ex: et ts=4 enc=utf-8 :


Generated: Wed Dec 3 01:30:02 2008 Cross-referenced by PHPXref 0.7