19 declare(strict_types=1);
28 require_once __DIR__ .
'/ProvideUTF8CodepointRange.php';
36 $this->assertInstanceOf(Json::class,
new Json());
39 #[DataProvider('provideTransformData')] 40 public function testTransform(
string $exptected,
string $in,
string $method): void
47 $this->expectException(JsonException::class);
54 'Empty string' => [
'""',
'',
'assertSame'],
55 'UTF-8' => [
'"\uc548\ub155\ud558\uc11c\u3163\uc694"',
'안녕하서ㅣ요',
'assertSame'],
56 'HTML special chars' => [
'"\\u003C\\u003E\\u0027\\u0022\\u0026"',
'<>\'"&',
'assertSame'],
57 'Characters beyond ASCII value 255' => [
'"\\u0100"',
'Ā',
'assertSame'],
58 'Characters beyond Unicode BMP' => [
'"\\ud800\\udc00"',
"\xF0\x90\x80\x80",
'assertSame'],
59 'Basic control characters and null' => [
'"\\r\\n\\t\\u0000"',
"\r\n\t\0",
'assertSame'],
60 'Single space' => [
'" "',
' ',
'assertSame'],
61 'Slash' => [
'"\\/"',
'/',
'assertSame'],