mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-24 09:09:22 +00:00
Cover Important Path in StringHelper
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user