Skip to content
Snippets Groups Projects
Commit d07dd8ee authored by chris's avatar chris
Browse files

unit_test fixes/changes

- auth_nameencode.test, add teardown code to clear new
  $cache_authname memory cache
- utf8_substr.test, correct expected result for last test

darcs-hash:20060927101118-9b6ab-a72ea443ba67e17946af34d67c274975d563a22f.gz
parent bda5ac44
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,11 @@ require_once DOKU_INC.'inc/auth.php';
class auth_nameencode_test extends UnitTestCase {
function teardown() {
global $cache_authname;
$cache_authname = array();
}
function test_simple(){
$in = 'hey$you';
$out = 'hey%24you';
......
......@@ -30,9 +30,9 @@ class utf8_substr_test extends UnitTestCase {
// we test multiple cases here - format: in, offset, length, out
$tests = array();
$str = str_pad('',strlen('в')*66000,'в').'@@';
$str = str_repeat('в',66000).'@@';
$tests[] = array($str, 65600, 1, 'в');
$tests[] = array($str,0,66000,$str);
$tests[] = array($str,0,66002,$str);
foreach($tests as $test){
$this->assertEqual(utf8_substr($test[0],$test[1],$test[2]),$test[3]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment