File tree 2 files changed +38
-7
lines changed
2 files changed +38
-7
lines changed Original file line number Diff line number Diff line change @@ -50,15 +50,30 @@ public function provideInvalidJsonStringValue(): \Generator
50
50
{
51
51
$ values = [
52
52
'does-not-start-with-forward-slash ' => 'foo ' ,
53
- 'property-with-unescaped-tilde ' => '/foo~bar ' ,
54
- 'property-with-unescaped-tildes ' => '/foo~~bar ' ,
53
+ 'property-with-tilde-followed-by-word ' => '/foo~bar ' ,
55
54
];
56
55
57
56
foreach ($ values as $ key => $ value ) {
58
57
yield $ key => [
59
58
$ value ,
60
59
];
61
60
}
61
+
62
+ foreach (\range (2 , 9 ) as $ digit ) {
63
+ $ key = \sprintf (
64
+ 'property-with-tilde-followed-by-digit-%d ' ,
65
+ $ digit ,
66
+ );
67
+
68
+ $ value = \sprintf (
69
+ '/foo~%d ' ,
70
+ $ digit ,
71
+ );
72
+
73
+ yield $ key => [
74
+ $ value ,
75
+ ];
76
+ }
62
77
}
63
78
64
79
/**
Original file line number Diff line number Diff line change @@ -47,15 +47,31 @@ public function testFromJsonStringRejectsInvalidValue(string $value): void
47
47
public function provideInvalidJsonStringValue (): \Generator
48
48
{
49
49
$ values = [
50
- 'property-with-unescaped -forward-slash ' => 'foo/bar ' ,
51
- 'property-with-unescaped- tilde ' => 'foo~bar ' ,
50
+ 'property-with-slash -forward ' => 'foo/bar ' ,
51
+ 'property-with-tilde-followed-by-word ' => 'foo~bar ' ,
52
52
];
53
53
54
54
foreach ($ values as $ key => $ value ) {
55
55
yield $ key => [
56
56
$ value ,
57
57
];
58
58
}
59
+
60
+ foreach (\range (2 , 9 ) as $ digit ) {
61
+ $ key = \sprintf (
62
+ 'property-with-tilde-followed-by-digit-%d ' ,
63
+ $ digit ,
64
+ );
65
+
66
+ $ value = \sprintf (
67
+ 'foo~%d ' ,
68
+ $ digit ,
69
+ );
70
+
71
+ yield $ key => [
72
+ $ value ,
73
+ ];
74
+ }
59
75
}
60
76
61
77
/**
@@ -124,7 +140,7 @@ public function provideValueAndJsonStringValue(): \Generator
124
140
"' " ,
125
141
"' " ,
126
142
],
127
- 'slash-backwards ' => [
143
+ 'slash-backward ' => [
128
144
'\\' ,
129
145
'\\' ,
130
146
],
@@ -168,11 +184,11 @@ public function provideValueAndJsonStringValue(): \Generator
168
184
"foo'bar " ,
169
185
"foo'bar " ,
170
186
],
171
- 'with-slash-backwards ' => [
187
+ 'with-slash-backward ' => [
172
188
'foo \\bar ' ,
173
189
'foo \\bar ' ,
174
190
],
175
- 'with-slash-forwards ' => [
191
+ 'with-slash-forward ' => [
176
192
'foo/bar ' ,
177
193
'foo~1bar ' ,
178
194
],
You can’t perform that action at this time.
0 commit comments