Cover Important Path in StringHelper

This commit is contained in:
oleibman
2025-09-01 07:45:27 -07:00
parent 3dfd3afff8
commit 2803d96129
3 changed files with 29 additions and 1 deletions
@@ -131,4 +131,14 @@ class StringHelperTest extends TestCase
$this->expectExceptionMessage('Unable to convert to string');
StringHelper::convertToString($dt);
}
public function testNoIconv(): void
{
$string = "\xBF"; // inverted question mark in ISO-8859-1
$expected = '¿';
$from = 'ISO-8859-1';
$to = 'UTF-8';
self::assertSame($expected, StringHelper::convertEncoding($string, $to, $from));
self::assertSame($expected, StringHelperNoIconv::convertEncoding($string, $to, $from));
}
}