19 declare(strict_types=1);
29 require_once __DIR__ .
'/ProvideUTF8CodepointRange.php';
40 #[DataProvider('provideTransformData')] 41 public function testTransform(
string $exptected,
string $in,
string $method): void
48 $this->expectException(ValueError::class);
54 $this->expectException(TypeError::class);
61 'Empty string' => [
'',
'',
'assertSame'],
62 'Single quote' => [
''',
'\'',
'assertSame'],
63 'Different quotes' => [
'"Hey, y'all"',
'"Hey, y' .
"'" .
'all"',
'assertSame'],
64 'UTF-8' => [
'김치',
'김치',
'assertSame'],
65 'Characters beyond ASCII value 255' => [
'Ā',
'Ā',
'assertSame'],
66 'Characters beyond Unicode BMP' => [
'𐀀',
"\xF0\x90\x80\x80",
'assertSame'],
67 'Printable control characters' => [
'
	',
"\r\n\t",
'assertSame'],
68 'Unprintable control characters' => [
'����',
"\0\1\x1F\x7F",
'assertSame'],
69 'Named entities' => [
'<>&"',
'<>&"',
'assertSame'],
70 'Single space' => [
' ',
' ',
'assertSame'],
71 'Encode entities' => [
'&quot;hello&quot;',
'"hello"',
'assertSame'],
72 'Braces' => [
'{[()]}',
'{[()]}',
'assertSame'],
73 ...self::oneByteRangeExcept([
',',
'.',
'-',
'_']),