File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,30 @@ public function testResolveSucceedsIfOptionValueAllowed2()
258
258
), $ this ->resolver ->resolve ($ options ));
259
259
}
260
260
261
+ public function testResolveSucceedsIfOptionalWithAllowedValuesNotSet ()
262
+ {
263
+ $ this ->resolver ->setRequired (array (
264
+ 'one ' ,
265
+ ));
266
+
267
+ $ this ->resolver ->setOptional (array (
268
+ 'two ' ,
269
+ ));
270
+
271
+ $ this ->resolver ->setAllowedValues (array (
272
+ 'one ' => array ('1 ' , 'one ' ),
273
+ 'two ' => array ('2 ' , 'two ' ),
274
+ ));
275
+
276
+ $ options = array (
277
+ 'one ' => '1 ' ,
278
+ );
279
+
280
+ $ this ->assertEquals (array (
281
+ 'one ' => '1 ' ,
282
+ ), $ this ->resolver ->resolve ($ options ));
283
+ }
284
+
261
285
/**
262
286
* @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
263
287
*/
You can’t perform that action at this time.
0 commit comments