From de542ff813cdf7f145d750e764f07e20143c5132 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Thu, 18 Nov 2010 06:14:59 +0000 Subject: [PATCH] NOBUG explaining why textlib sorting fails --- lib/simpletest/testtextlib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/simpletest/testtextlib.php b/lib/simpletest/testtextlib.php index 960bedd56ca..19e0fc51510 100644 --- a/lib/simpletest/testtextlib.php +++ b/lib/simpletest/testtextlib.php @@ -48,9 +48,15 @@ class textlib_test extends UnitTestCase { $this->assertIdentical(array_keys($arr), array(1, 'b', 0)); $this->assertIdentical(array_values($arr), array('aa', 'ab', 'cc')); + if (extension_loaded('intl')) { + $error = 'Collation aware sorting not supported'; + } else { + $error = 'Collation aware sorting not supported, PHP extension "intl" is not available.'; + } + $arr = array('a'=>'áb', 'b'=>'ab', 1=>'aa', 0=>'cc'); textlib_get_instance()->asort($arr); - $this->assertIdentical(array_keys($arr), array(1, 'b', 'a', 0), 'Collation aware sorting not supported'); + $this->assertIdentical(array_keys($arr), array(1, 'b', 'a', 0), $error); unset($SESSION->lang); } -- 2.43.0