@@ -236,8 +236,8 @@ public function testSingleChoice()
236
236
{
237
237
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
238
238
'property_path ' => 'name ' ,
239
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
240
- 'data ' => 'a ' ,
239
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
240
+ 'data ' => '& a ' ,
241
241
'multiple ' => false ,
242
242
'expanded ' => false ,
243
243
));
@@ -246,8 +246,8 @@ public function testSingleChoice()
246
246
'/select
247
247
[@name="na&me"]
248
248
[
249
- ./option[@value="a"][@selected="selected"][.="Choice A"]
250
- /following-sibling::option[@value="b"][not(@selected)][.="Choice B"]
249
+ ./option[@value="& a"][@selected="selected"][.="Choice& A"]
250
+ /following-sibling::option[@value="& b"][not(@selected)][.="Choice& B"]
251
251
]
252
252
[count(./option)=2]
253
253
'
@@ -258,9 +258,9 @@ public function testSingleChoiceWithPreferred()
258
258
{
259
259
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
260
260
'property_path ' => 'name ' ,
261
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
262
- 'preferred_choices ' => array ('b ' ),
263
- 'data ' => 'a ' ,
261
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
262
+ 'preferred_choices ' => array ('& b ' ),
263
+ 'data ' => '& a ' ,
264
264
'multiple ' => false ,
265
265
'expanded ' => false ,
266
266
));
@@ -269,9 +269,9 @@ public function testSingleChoiceWithPreferred()
269
269
'/select
270
270
[@name="na&me"]
271
271
[
272
- ./option[@value="b"][not(@selected)][.="Choice B"]
272
+ ./option[@value="& b"][not(@selected)][.="Choice& B"]
273
273
/following-sibling::option[@disabled="disabled"][not(@selected)][.="-- sep --"]
274
- /following-sibling::option[@value="a"][@selected="selected"][.="Choice A"]
274
+ /following-sibling::option[@value="& a"][@selected="selected"][.="Choice& A"]
275
275
]
276
276
[count(./option)=3]
277
277
'
@@ -282,9 +282,9 @@ public function testSingleChoiceNonRequired()
282
282
{
283
283
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
284
284
'property_path ' => 'name ' ,
285
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
285
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
286
286
'required ' => false ,
287
- 'data ' => 'a ' ,
287
+ 'data ' => '& a ' ,
288
288
'multiple ' => false ,
289
289
'expanded ' => false ,
290
290
));
@@ -294,8 +294,8 @@ public function testSingleChoiceNonRequired()
294
294
[@name="na&me"]
295
295
[
296
296
./option[@value=""][.=""]
297
- /following-sibling::option[@value="a"][@selected="selected"][.="Choice A"]
298
- /following-sibling::option[@value="b"][not(@selected)][.="Choice B"]
297
+ /following-sibling::option[@value="& a"][@selected="selected"][.="Choice& A"]
298
+ /following-sibling::option[@value="& b"][not(@selected)][.="Choice& B"]
299
299
]
300
300
[count(./option)=3]
301
301
'
@@ -307,26 +307,26 @@ public function testSingleChoiceGrouped()
307
307
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
308
308
'property_path ' => 'name ' ,
309
309
'choices ' => array (
310
- 'Group1 ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
311
- 'Group2 ' => array ('c ' => 'Choice C ' ),
310
+ 'Group&1 ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
311
+ 'Group&2 ' => array ('& c ' => 'Choice& C ' ),
312
312
),
313
- 'data ' => 'a ' ,
313
+ 'data ' => '& a ' ,
314
314
'multiple ' => false ,
315
315
'expanded ' => false ,
316
316
));
317
317
318
318
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
319
319
'/select
320
320
[@name="na&me"]
321
- [./optgroup[@label="Group1 "]
321
+ [./optgroup[@label="Group&1 "]
322
322
[
323
- ./option[@value="a"][@selected="selected"][.="Choice A"]
324
- /following-sibling::option[@value="b"][not(@selected)][.="Choice B"]
323
+ ./option[@value="& a"][@selected="selected"][.="Choice& A"]
324
+ /following-sibling::option[@value="& b"][not(@selected)][.="Choice& B"]
325
325
]
326
326
[count(./option)=2]
327
327
]
328
- [./optgroup[@label="Group2 "]
329
- [./option[@value="c"][not(@selected)][.="Choice C"]]
328
+ [./optgroup[@label="Group&2 "]
329
+ [./option[@value="& c"][not(@selected)][.="Choice& C"]]
330
330
[count(./option)=1]
331
331
]
332
332
[count(./optgroup)=2]
@@ -338,8 +338,8 @@ public function testMultipleChoice()
338
338
{
339
339
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
340
340
'property_path ' => 'name ' ,
341
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
342
- 'data ' => array ('a ' ),
341
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
342
+ 'data ' => array ('& a ' ),
343
343
'multiple ' => true ,
344
344
'expanded ' => false ,
345
345
));
@@ -349,8 +349,8 @@ public function testMultipleChoice()
349
349
[@name="na&me[]"]
350
350
[@multiple="multiple"]
351
351
[
352
- ./option[@value="a"][@selected="selected"][.="Choice A"]
353
- /following-sibling::option[@value="b"][not(@selected)][.="Choice B"]
352
+ ./option[@value="& a"][@selected="selected"][.="Choice& A"]
353
+ /following-sibling::option[@value="& b"][not(@selected)][.="Choice& B"]
354
354
]
355
355
[count(./option)=2]
356
356
'
@@ -361,8 +361,8 @@ public function testMultipleChoiceNonRequired()
361
361
{
362
362
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
363
363
'property_path ' => 'name ' ,
364
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
365
- 'data ' => array ('a ' ),
364
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
365
+ 'data ' => array ('& a ' ),
366
366
'required ' => false ,
367
367
'multiple ' => true ,
368
368
'expanded ' => false ,
@@ -373,8 +373,8 @@ public function testMultipleChoiceNonRequired()
373
373
[@name="na&me[]"]
374
374
[@multiple="multiple"]
375
375
[
376
- ./option[@value="a"][@selected="selected"][.="Choice A"]
377
- /following-sibling::option[@value="b"][not(@selected)][.="Choice B"]
376
+ ./option[@value="& a"][@selected="selected"][.="Choice& A"]
377
+ /following-sibling::option[@value="& b"][not(@selected)][.="Choice& B"]
378
378
]
379
379
[count(./option)=2]
380
380
'
@@ -385,19 +385,19 @@ public function testSingleChoiceExpanded()
385
385
{
386
386
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
387
387
'property_path ' => 'name ' ,
388
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' ),
389
- 'data ' => 'a ' ,
388
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' ),
389
+ 'data ' => '& a ' ,
390
390
'multiple ' => false ,
391
391
'expanded ' => true ,
392
392
));
393
393
394
394
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
395
395
'/div
396
396
[
397
- ./input[@type="radio"][@name="na&me"][@id="na&me_a "][@checked]
398
- /following-sibling::label[@for="na&me_a "][.="[trans]Choice A[/trans]"]
399
- /following-sibling::input[@type="radio"][@name="na&me"][@id="na&me_b "][not(@checked)]
400
- /following-sibling::label[@for="na&me_b "][.="[trans]Choice B[/trans]"]
397
+ ./input[@type="radio"][@name="na&me"][@id="na&me_&a "][@checked]
398
+ /following-sibling::label[@for="na&me_&a "][.="[trans]Choice& A[/trans]"]
399
+ /following-sibling::input[@type="radio"][@name="na&me"][@id="na&me_&b "][not(@checked)]
400
+ /following-sibling::label[@for="na&me_&b "][.="[trans]Choice& B[/trans]"]
401
401
]
402
402
[count(./input)=2]
403
403
'
@@ -408,21 +408,21 @@ public function testMultipleChoiceExpanded()
408
408
{
409
409
$ form = $ this ->factory ->create ('choice ' , 'na&me ' , array (
410
410
'property_path ' => 'name ' ,
411
- 'choices ' => array ('a ' => 'Choice A ' , 'b ' => 'Choice B ' , 'c ' => 'Choice C ' ),
412
- 'data ' => array ('a ' , 'c ' ),
411
+ 'choices ' => array ('& a ' => 'Choice& A ' , '& b ' => 'Choice& B ' , '& c ' => 'Choice& C ' ),
412
+ 'data ' => array ('& a ' , '& c ' ),
413
413
'multiple ' => true ,
414
414
'expanded ' => true ,
415
415
));
416
416
417
417
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
418
418
'/div
419
419
[
420
- ./input[@type="checkbox"][@name="na&me[a]"][@id="na&me_a "][@checked]
421
- /following-sibling::label[@for="na&me_a "][.="[trans]Choice A[/trans]"]
422
- /following-sibling::input[@type="checkbox"][@name="na&me[b]"][@id="na&me_b "][not(@checked)]
423
- /following-sibling::label[@for="na&me_b "][.="[trans]Choice B[/trans]"]
424
- /following-sibling::input[@type="checkbox"][@name="na&me[c]"][@id="na&me_c "][@checked]
425
- /following-sibling::label[@for="na&me_c "][.="[trans]Choice C[/trans]"]
420
+ ./input[@type="checkbox"][@name="na&me[& a]"][@id="na&me_&a "][@checked]
421
+ /following-sibling::label[@for="na&me_&a "][.="[trans]Choice& A[/trans]"]
422
+ /following-sibling::input[@type="checkbox"][@name="na&me[& b]"][@id="na&me_&b "][not(@checked)]
423
+ /following-sibling::label[@for="na&me_&b "][.="[trans]Choice& B[/trans]"]
424
+ /following-sibling::input[@type="checkbox"][@name="na&me[& c]"][@id="na&me_&c "][@checked]
425
+ /following-sibling::label[@for="na&me_&c "][.="[trans]Choice& C[/trans]"]
426
426
]
427
427
[count(./input)=3]
428
428
'
0 commit comments