MDL-31142 fix textlib::substr() performance, invalid length in iconv_substr; use mbstring by default

This commit is contained in:
Petr Skoda
2012-01-16 09:17:36 +01:00
parent f70f6e9ad1
commit 76917f764f
2 changed files with 46 additions and 11 deletions
+2
View File
@@ -83,6 +83,8 @@ class textlib_test extends UnitTestCase {
public function test_substr() {
$str = "Žluťoučký koníček";
$this->assertIdentical(textlib::substr($str, 0), $str);
$this->assertIdentical(textlib::substr($str, 1), 'luťoučký koníček');
$this->assertIdentical(textlib::substr($str, 1, 3), 'luť');
$this->assertIdentical(textlib::substr($str, 0, 100), $str);
$this->assertIdentical(textlib::substr($str, -3, 2), 'če');