From 69a8e7e68b523ee5de4fe496df2f9c09af5b5c77 Mon Sep 17 00:00:00 2001 From: sunil Date: Thu, 30 Jun 2016 17:57:49 +0530 Subject: [PATCH] added testcase to verify utf-8 string --- tests/phpunit/CRM/Utils/StringTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/CRM/Utils/StringTest.php b/tests/phpunit/CRM/Utils/StringTest.php index 1aed89c67a..80c04e10f5 100644 --- a/tests/phpunit/CRM/Utils/StringTest.php +++ b/tests/phpunit/CRM/Utils/StringTest.php @@ -86,6 +86,10 @@ class CRM_Utils_StringTest extends CiviUnitTestCase { foreach ($cases as $input => $expected) { $this->assertEquals($expected, CRM_Utils_String::ellipsify($input, $maxLen)); } + // test utf-8 string, CRM-18997 + $input = 'Registro de eventos on-line: Taller: "Onboarding - Cómo integrar exitosamente a los nuevos talentos dentro de su organización - Formación práctica."'; + $maxLen = 128; + $this->assertEquals(true, mb_check_encoding(CRM_Utils_String::ellipsify($input, $maxLen), 'UTF-8')); } public function testRandom() { -- 2.25.1