X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FMail%2FHtmlToTextTest.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FMail%2FHtmlToTextTest.php;h=02bfca8441263d4f0ba2bf15ec1aab91ddd3f118;hp=bdbfd749c94804008963a43757f2626823836e0c;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php b/web/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php index bdbfd749c..02bfca844 100644 --- a/web/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php +++ b/web/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\system\Functional\Mail; use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\Unicode; use Drupal\Core\Mail\MailFormatHelper; use Drupal\Core\Site\Settings; use Drupal\Tests\BrowserTestBase; @@ -14,6 +13,7 @@ use Drupal\Tests\BrowserTestBase; * @group Mail */ class HtmlToTextTest extends BrowserTestBase { + /** * Converts a string to its PHP source equivalent for display in test messages. * @@ -48,7 +48,7 @@ class HtmlToTextTest extends BrowserTestBase { * \Drupal\Core\Mail\MailFormatHelper::htmlToText(). */ protected function assertHtmlToText($html, $text, $message, $allowed_tags = NULL) { - preg_match_all('/<([a-z0-6]+)/', Unicode::strtolower($html), $matches); + preg_match_all('/<([a-z0-6]+)/', mb_strtolower($html), $matches); $tested_tags = implode(', ', array_unique($matches[1])); $message .= ' (' . $tested_tags . ')'; $result = MailFormatHelper::htmlToText($html, $allowed_tags); @@ -241,8 +241,8 @@ class HtmlToTextTest extends BrowserTestBase { if (!$pass) { $this->verbose($this->stringToHtml($output)); } - $output_upper = Unicode::strtoupper($output); - $upper_input = Unicode::strtoupper($input); + $output_upper = mb_strtoupper($output); + $upper_input = mb_strtoupper($input); $upper_output = MailFormatHelper::htmlToText($upper_input); $pass = $this->assertEqual( $upper_output, @@ -347,8 +347,8 @@ class HtmlToTextTest extends BrowserTestBase { $maximum_line_length = 0; foreach (explode($eol, $output) as $line) { - // We must use strlen() rather than Unicode::strlen() in order to count - // octets rather than characters. + // We must use strlen() rather than mb_strlen() in order to count octets + // rather than characters. $maximum_line_length = max($maximum_line_length, strlen($line . $eol)); } $verbose = 'Maximum line length found was ' . $maximum_line_length . ' octets.';