Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30494 grade: provided a failure string to gives people experienci…

…ng UTF character test failures a starting point for fixing the problem
  • Loading branch information...
commit 39ee0ced4af0823518e83d5f9a3d848e04ac5d5d 1 parent 58800b7
@andyjdavis andyjdavis authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 grade/grading/simpletest/testlib.php
View
8 grade/grading/simpletest/testlib.php
@@ -131,11 +131,13 @@ public function test_set_and_get_grading_area() {
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);
Please sign in to comment.
Something went wrong with that request. Please try again.