diff options
author | chris <chris@jalakai.co.uk> | 2006-09-27 12:11:18 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-09-27 12:11:18 +0200 |
commit | d07dd8ee598c9b9dc8dfc9a61e0fdfa023ad59de (patch) | |
tree | e96e740ee9ef120e16d1346c6749bc6a693fdfee | |
parent | bda5ac444807bf8763ad361a535a0194842067a7 (diff) | |
download | rpg-d07dd8ee598c9b9dc8dfc9a61e0fdfa023ad59de.tar.gz rpg-d07dd8ee598c9b9dc8dfc9a61e0fdfa023ad59de.tar.bz2 |
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
-rw-r--r-- | _test/cases/inc/auth_nameencode.test.php | 5 | ||||
-rw-r--r-- | _test/cases/inc/utf8_substr.test.php | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/_test/cases/inc/auth_nameencode.test.php b/_test/cases/inc/auth_nameencode.test.php index 926937a09..1e29b77fd 100644 --- a/_test/cases/inc/auth_nameencode.test.php +++ b/_test/cases/inc/auth_nameencode.test.php @@ -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'; diff --git a/_test/cases/inc/utf8_substr.test.php b/_test/cases/inc/utf8_substr.test.php index 5cb93034a..f3bf1b154 100644 --- a/_test/cases/inc/utf8_substr.test.php +++ b/_test/cases/inc/utf8_substr.test.php @@ -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]); |