Skip to content

Commit 550b25b

Browse files
committed
Merge branch '2.6' into 2.7
2 parents b4f6360 + 65ca841 commit 550b25b

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
@@ -359,7 +359,7 @@ public function testSingleChoiceNonRequired()
359359
[@class="my&class form-control"]
360360
[not(@required)]
361361
[
362-
./option[@value=""][.="[trans][/trans]"]
362+
./option[@value=""][.=""]
363363
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
364364
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
365365
]
@@ -383,7 +383,7 @@ public function testSingleChoiceNonRequiredNoneSelected()
383383
[@class="my&class form-control"]
384384
[not(@required)]
385385
[
386-
./option[@value=""][.="[trans][/trans]"]
386+
./option[@value=""][.=""]
387387
/following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"]
388388
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
389389
]
@@ -457,7 +457,7 @@ public function testSingleChoiceRequiredWithPlaceholderViaView()
457457
[@class="my&class form-control"]
458458
[@required="required"]
459459
[
460-
./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]
460+
./option[@value=""][not(@selected)][not(@disabled)][.=""]
461461
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
462462
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
463463
]
@@ -1278,17 +1278,17 @@ public function testBirthDayWithPlaceholder()
12781278
./select
12791279
[@id="name_month"]
12801280
[@class="form-control"]
1281-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1281+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
12821282
[./option[@value="1"][@selected="selected"]]
12831283
/following-sibling::select
12841284
[@id="name_day"]
12851285
[@class="form-control"]
1286-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1286+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
12871287
[./option[@value="1"][@selected="selected"]]
12881288
/following-sibling::select
12891289
[@id="name_year"]
12901290
[@class="form-control"]
1291-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1291+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
12921292
[./option[@value="1950"][@selected="selected"]]
12931293
]
12941294
[count(./select)=3]

Tests/AbstractLayoutTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ public function testSingleChoiceNonRequired()
635635
[@name="name"]
636636
[not(@required)]
637637
[
638-
./option[@value=""][.="[trans][/trans]"]
638+
./option[@value=""][.=""]
639639
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
640640
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
641641
]
@@ -658,7 +658,7 @@ public function testSingleChoiceNonRequiredNoneSelected()
658658
[@name="name"]
659659
[not(@required)]
660660
[
661-
./option[@value=""][.="[trans][/trans]"]
661+
./option[@value=""][.=""]
662662
/following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"]
663663
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
664664
]
@@ -735,7 +735,7 @@ public function testSingleChoiceRequiredWithPlaceholderViaView()
735735
[@name="name"]
736736
[@required="required"]
737737
[
738-
./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]
738+
./option[@value=""][not(@selected)][not(@disabled)][.=""]
739739
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
740740
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
741741
]
@@ -1442,15 +1442,15 @@ public function testBirthDayWithPlaceholder()
14421442
[
14431443
./select
14441444
[@id="name_month"]
1445-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1445+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
14461446
[./option[@value="1"][@selected="selected"]]
14471447
/following-sibling::select
14481448
[@id="name_day"]
1449-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1449+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
14501450
[./option[@value="1"][@selected="selected"]]
14511451
/following-sibling::select
14521452
[@id="name_year"]
1453-
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
1453+
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
14541454
[./option[@value="1950"][@selected="selected"]]
14551455
]
14561456
[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)