diff options
author | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-18 12:08:28 +0200 |
---|---|---|
committer | Tobias Sarnowski <sarnowski@cosmocode.de> | 2012-04-18 12:08:28 +0200 |
commit | f8369d7d6e37248d6523fdac6e1d760fca4f1b52 (patch) | |
tree | 0848c213ffc191a23b55f07bd2ec55e777ea79ca /_test/tests/inc/utf8_stripspecials.test.php | |
parent | d59108b91e9bf9fd56dc2e697cf31f9bbc7f9cd4 (diff) | |
download | rpg-f8369d7d6e37248d6523fdac6e1d760fca4f1b52.tar.gz rpg-f8369d7d6e37248d6523fdac6e1d760fca4f1b52.tar.bz2 |
moved _testing to _test
Diffstat (limited to '_test/tests/inc/utf8_stripspecials.test.php')
-rw-r--r-- | _test/tests/inc/utf8_stripspecials.test.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/_test/tests/inc/utf8_stripspecials.test.php b/_test/tests/inc/utf8_stripspecials.test.php new file mode 100644 index 000000000..532430b60 --- /dev/null +++ b/_test/tests/inc/utf8_stripspecials.test.php @@ -0,0 +1,28 @@ +<?php +// use no mbstring help here +if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); +require_once DOKU_INC.'inc/utf8.php'; + +class utf8_stripspecials extends DokuWikiTest { + + + function test1(){ + // we test multiple cases here - format: string, repl, additional, test + $tests = array(); + $tests[] = array('asciistring','','','asciistring'); + $tests[] = array('asciistring','','\._\-:','asciistring'); + $tests[] = array('ascii.string','','\._\-:','asciistring'); + $tests[] = array('ascii.string',' ','\._\-:','ascii string'); + $tests[] = array('2.1.14',' ','\._\-:','2 1 14'); + $tests[] = array('ascii.string','','\._\-:\*','asciistring'); + $tests[] = array('ascii.string',' ','\._\-:\*','ascii string'); + $tests[] = array('2.1.14',' ','\._\-:\*','2 1 14'); + $tests[] = array('string with nbsps','_','\*','string_with_nbsps'); + + foreach($tests as $test){ + $this->assertEquals(utf8_stripspecials($test[0],$test[1],$test[2]),$test[3]); + } + } + +} +//Setup VIM: ex: et ts=4 : |