Skip to content

Commit 7711ea9

Browse files
committed
Merge branch '2.3' into 2.6
Conflicts: src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/choice_widget_collapsed.html.php
2 parents 06acaea + 4a72cca commit 7711ea9

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

Extension/Core/EventListener/ResizeFormListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function preSubmit(FormEvent $event)
107107
}
108108

109109
if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) {
110-
throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)');
110+
$data = array();
111111
}
112112

113113
// Remove all empty rows

Tests/AbstractBootstrap3LayoutTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ public function testSingleChoiceNonRequired()
334334
[@class="my&class form-control"]
335335
[not(@required)]
336336
[
337-
./option[@value=""][.="[trans][/trans]"]
337+
./option[@value=""][.=""]
338338
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
339339
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
340340
]
@@ -358,7 +358,7 @@ public function testSingleChoiceNonRequiredNoneSelected()
358358
[@class="my&class form-control"]
359359
[not(@required)]
360360
[
361-
./option[@value=""][.="[trans][/trans]"]
361+
./option[@value=""][.=""]
362362
/following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"]
363363
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
364364
]
@@ -432,7 +432,7 @@ public function testSingleChoiceRequiredWithPlaceholderViaView()
432432
[@class="my&class form-control"]
433433
[@required="required"]
434434
[
435-
./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]
435+
./option[@value=""][not(@selected)][not(@disabled)][.=""]
436436
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
437437
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
438438
]
@@ -1140,17 +1140,17 @@ public function testBirthDayWithPlaceholder()
11401140
./select
11411141
[@id="name_month"]
11421142
[@class="form-control"]
1143-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1143+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
11441144
[./option[@value="1"][@selected="selected"]]
11451145
/following-sibling::select
11461146
[@id="name_day"]
11471147
[@class="form-control"]
1148-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1148+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
11491149
[./option[@value="1"][@selected="selected"]]
11501150
/following-sibling::select
11511151
[@id="name_year"]
11521152
[@class="form-control"]
1153-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1153+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
11541154
[./option[@value="1950"][@selected="selected"]]
11551155
]
11561156
[count(./select)=3]

Tests/AbstractLayoutTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ public function testSingleChoiceNonRequired()
614614
[@name="name"]
615615
[not(@required)]
616616
[
617-
./option[@value=""][.="[trans][/trans]"]
617+
./option[@value=""][.=""]
618618
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
619619
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
620620
]
@@ -637,7 +637,7 @@ public function testSingleChoiceNonRequiredNoneSelected()
637637
[@name="name"]
638638
[not(@required)]
639639
[
640-
./option[@value=""][.="[trans][/trans]"]
640+
./option[@value=""][.=""]
641641
/following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"]
642642
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
643643
]
@@ -714,7 +714,7 @@ public function testSingleChoiceRequiredWithPlaceholderViaView()
714714
[@name="name"]
715715
[@required="required"]
716716
[
717-
./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]
717+
./option[@value=""][not(@selected)][not(@disabled)][.=""]
718718
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
719719
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
720720
]
@@ -1342,15 +1342,15 @@ public function testBirthDayWithPlaceholder()
13421342
[
13431343
./select
13441344
[@id="name_month"]
1345-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1345+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
13461346
[./option[@value="1"][@selected="selected"]]
13471347
/following-sibling::select
13481348
[@id="name_day"]
1349-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1349+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
13501350
[./option[@value="1"][@selected="selected"]]
13511351
/following-sibling::select
13521352
[@id="name_year"]
1353-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1353+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
13541354
[./option[@value="1950"][@selected="selected"]]
13551355
]
13561356
[count(./select)=3]

Tests/Extension/Core/EventListener/ResizeFormListenerTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,14 @@ public function testPreSubmitDoesNothingIfNotAllowAddNorAllowDelete()
167167
$this->assertFalse($this->form->has('2'));
168168
}
169169

170-
/**
171-
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
172-
*/
173-
public function testPreSubmitRequiresArrayOrTraversable()
170+
public function testPreSubmitDealsWithNoArrayOrTraversable()
174171
{
175172
$data = 'no array or traversable';
176173
$event = new FormEvent($this->form, $data);
177174
$listener = new ResizeFormListener('text', array(), false, false);
178175
$listener->preSubmit($event);
176+
177+
$this->assertFalse($this->form->has('1'));
179178
}
180179

181180
public function testPreSubmitDealsWithNullData()

0 commit comments

Comments
 (0)