MDL-30494 grade: provided a failure string to gives people experiencing UTF character...
authorAndrew Davis <andrew@moodle.com>
Wed, 30 Nov 2011 03:41:00 +0000 (11:41 +0800)
committerAndrew Davis <andrew@moodle.com>
Wed, 30 Nov 2011 03:49:39 +0000 (11:49 +0800)
grade/grading/simpletest/testlib.php

index ea3c413..3e489b8 100644 (file)
@@ -131,11 +131,13 @@ class grading_manager_test extends UnitTestCase {
 
     public function test_tokenize() {
 
+        $UTFfailuremessage = 'A test using UTF-8 characters has failed. Consider updating PHP and PHP\'s PCRE or INTL extensions (MDL-30494)';
+
         $needle = "    šašek, \n\n   \r    a král;  \t";
         $tokens = testable_grading_manager::tokenize($needle);
-        $this->assertEqual(2, count($tokens));
-        $this->assertTrue(in_array('šašek', $tokens));
-        $this->assertTrue(in_array('král', $tokens));
+        $this->assertEqual(2, count($tokens), $UTFfailuremessage);
+        $this->assertTrue(in_array('šašek', $tokens), $UTFfailuremessage);
+        $this->assertTrue(in_array('král', $tokens), $UTFfailuremessage);
 
         $needle = ' "   šašek a král "    ';
         $tokens = testable_grading_manager::tokenize($needle);