Skip to content

Commit 1f62a72

Browse files
committed
tests added to bugfix: patternProperties raised errors when the pattern contained slash.
1 parent 2dac5ac commit 1f62a72

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

tests/JsonSchema/Tests/Constraints/PatternPropertiesTest.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,29 @@ public function getValidTests()
8282
),
8383
'someotherobject' => array(
8484
'foobar' => 1234,
85+
),
86+
'/products' => array(
87+
'get' => array()
88+
),
89+
'#products' => array(
90+
'get' => array()
91+
),
92+
'+products' => array(
93+
'get' => array()
94+
),
95+
'~products' => array(
96+
'get' => array()
97+
),
98+
'*products' => array(
99+
'get' => array()
100+
),
101+
'%products' => array(
102+
'get' => array()
85103
)
86104
)),
87105
json_encode(array(
88106
'type' => 'object',
107+
'additionalProperties' => false,
89108
'patternProperties' => array(
90109
'^someobject$' => array(
91110
'type' => 'object',
@@ -100,6 +119,42 @@ public function getValidTests()
100119
'foobar' => array('type' => 'number'),
101120
),
102121
),
122+
'^/' => array(
123+
'type' => 'object',
124+
'properties' => array(
125+
'get' => array('type' => 'array')
126+
)
127+
),
128+
'^#' => array(
129+
'type' => 'object',
130+
'properties' => array(
131+
'get' => array('type' => 'array')
132+
)
133+
),
134+
'^\+' => array(
135+
'type' => 'object',
136+
'properties' => array(
137+
'get' => array('type' => 'array')
138+
)
139+
),
140+
'^~' => array(
141+
'type' => 'object',
142+
'properties' => array(
143+
'get' => array('type' => 'array')
144+
)
145+
),
146+
'^\*' => array(
147+
'type' => 'object',
148+
'properties' => array(
149+
'get' => array('type' => 'array')
150+
)
151+
),
152+
'^%' => array(
153+
'type' => 'object',
154+
'properties' => array(
155+
'get' => array('type' => 'array')
156+
)
157+
)
103158
)
104159
))
105160
),

0 commit comments

Comments
 (0)