1<?php 2// use no mbstring help here 3if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); 4 5class utf8_stripspecials extends DokuWikiTest { 6 7 8 function test1(){ 9 // we test multiple cases here - format: string, repl, additional, test 10 $tests = array(); 11 $tests[] = array('asciistring','','','asciistring'); 12 $tests[] = array('asciistring','','\._\-:','asciistring'); 13 $tests[] = array('ascii.string','','\._\-:','asciistring'); 14 $tests[] = array('ascii.string',' ','\._\-:','ascii string'); 15 $tests[] = array('2.1.14',' ','\._\-:','2 1 14'); 16 $tests[] = array('ascii.string','','\._\-:\*','asciistring'); 17 $tests[] = array('ascii.string',' ','\._\-:\*','ascii string'); 18 $tests[] = array('2.1.14',' ','\._\-:\*','2 1 14'); 19 $tests[] = array('string with nbsps','_','\*','string_with_nbsps'); 20 21 foreach($tests as $test){ 22 $this->assertEquals(utf8_stripspecials($test[0],$test[1],$test[2]),$test[3]); 23 } 24 } 25 26} 27//Setup VIM: ex: et ts=4 : 28