From afa041c306ec29278e62d87e1d6da5ebc6b48e12 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 1 Aug 2025 21:27:10 +0200 Subject: [PATCH] account for error message changes in PHP 8.5 --- .../Tests/Transliterator/EmojiTransliteratorTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Intl/Tests/Transliterator/EmojiTransliteratorTest.php b/src/Symfony/Component/Intl/Tests/Transliterator/EmojiTransliteratorTest.php index 38b218db7225b..be618c601f0ce 100644 --- a/src/Symfony/Component/Intl/Tests/Transliterator/EmojiTransliteratorTest.php +++ b/src/Symfony/Component/Intl/Tests/Transliterator/EmojiTransliteratorTest.php @@ -109,7 +109,8 @@ public static function provideLocaleTest(): iterable public function testTransliterateWithInvalidLocale() { $this->expectException(\IntlException::class); - $this->expectExceptionMessage('transliterator_create: unable to open ICU transliterator with id "emoji-invalid"'); + + $this->expectExceptionMessage(\sprintf('%s: unable to open ICU transliterator with id "emoji-invalid":', \PHP_VERSION_ID >= 80500 ? 'Transliterator::create()' : 'transliterator_create')); EmojiTransliterator::create('invalid'); } @@ -133,7 +134,7 @@ public function testNotUtf8() $this->iniSet('intl.use_exceptions', 0); $this->assertFalse($tr->transliterate("Not \xE9 UTF-8")); - $this->assertSame('String conversion of string to UTF-16 failed: U_INVALID_CHAR_FOUND', intl_get_error_message()); + $this->assertSame(\sprintf('%sString conversion of string to UTF-16 failed: U_INVALID_CHAR_FOUND', \PHP_VERSION_ID >= 80500 ? 'Transliterator::transliterate(): ' : ''), intl_get_error_message()); $this->iniSet('intl.use_exceptions', 1); @@ -150,12 +151,12 @@ public function testBadOffsets() $this->iniSet('intl.use_exceptions', 0); $this->assertFalse($tr->transliterate('Abc', 1, 5)); - $this->assertSame('transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3): U_ILLEGAL_ARGUMENT_ERROR', intl_get_error_message()); + $this->assertSame(\sprintf('%s: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3): U_ILLEGAL_ARGUMENT_ERROR', \PHP_VERSION_ID >= 80500 ? 'Transliterator::transliterate()' : 'transliterator_transliterate'), intl_get_error_message()); $this->iniSet('intl.use_exceptions', 1); $this->expectException(\IntlException::class); - $this->expectExceptionMessage('transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3)'); + $this->expectExceptionMessage(\sprintf('%s: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 3)', \PHP_VERSION_ID >= 80500 ? 'Transliterator::transliterate()' : 'transliterator_transliterate')); $this->assertFalse($tr->transliterate('Abc', 1, 5)); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy