[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/_test/cases/inc/ -> auth_nameencode.test.php (source)

   1  <?php
   2  
   3  require_once  DOKU_INC.'inc/init.php';
   4  require_once  DOKU_INC.'inc/auth.php';
   5  
   6  class auth_nameencode_test extends UnitTestCase {
   7  
   8      function teardown() {
   9          global $cache_authname;
  10          $cache_authname = array();
  11      }
  12  
  13      function test_simple(){
  14          $in  = 'hey$you';
  15          $out = 'hey%24you';
  16          $this->assertEqual(auth_nameencode($in),$out);
  17      }
  18  
  19      function test_quote(){
  20          $in  = 'hey"you';
  21          $out = 'hey%22you';
  22          $this->assertEqual(auth_nameencode($in),$out);
  23      }
  24  
  25      function test_complex(){
  26          $in  = 'hey $ you !$%! foo ';
  27          $out = 'hey%20%24%20you%20%21%24%25%21%20foo%20';
  28          $this->assertEqual(auth_nameencode($in),$out);
  29      }
  30  
  31      function test_complexutf8(){
  32          $in  = 'häü $ yü !$%! foo ';
  33          $out = 'häü%20%24%20yü%20%21%24%25%21%20foo%20';
  34          $this->assertEqual(auth_nameencode($in),$out);
  35      }
  36  
  37      function test_groupskipon(){
  38          $in  = '@hey$you';
  39          $out = '@hey%24you';
  40          $this->assertEqual(auth_nameencode($in,true),$out);
  41      }
  42  
  43      function test_groupskipoff(){
  44          $in  = '@hey$you';
  45          $out = '%40hey%24you';
  46          $this->assertEqual(auth_nameencode($in),$out);
  47      }
  48  }
  49  
  50  //Setup VIM: ex: et ts=4 enc=utf-8 :


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