8000 Merge branch '2.7' into 2.8 · symfony/symfony@bcdf568 · GitHub
[go: up one dir, main page]

Skip to content

Commit bcdf568

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Fix computation of PR diffs for component matrix lines [BUG] Delete class 'control-group' in bootstrap 3 [2.8] [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper
2 parents 208e6b0 + 66da91d commit bcdf568

File tree

4 files changed

+30
-18
lines changed
  • src/Symfony

4 files changed

+30
-18
lines changed

.travis.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<?php
22

33
if (4 > $_SERVER['argc']) {
4-
echo "Usage: commit-range branch dir1 dir2 ... dirN\n";
4+
echo "Usage: branch dir1 dir2 ... dirN\n";
55
exit(1);
66
}
77

88
$dirs = $_SERVER['argv'];
99
array_shift($dirs);
10-
$range = array_shift($dirs);
1110
$branch = array_shift($dirs);
1211

1312
$packages = array();
1413
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
1514

1615
foreach ($dirs as $dir) {
17-
if (!`git diff --name-only $range -- $dir`) {
16+
if (!`git diff --name-only $branch...HEAD -- $dir`) {
1817
continue;
1918
}
2019
echo "$dir\n";

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ before_install:
5959
install:
6060
- if [[ ! $skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
6161
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
62-
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi
62+
- if [[ ! $skip && $deps ]]; then php .travis.php $TRAVIS_BRANCH $COMPONENTS; fi
6363
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
6464
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi
6565
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); ./phpunit install; fi

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,12 @@
9494

9595
{% block choice_widget_expanded -%}
9696
{% if '-inline' in label_attr.class|default('') -%}
97-
<div class="control-group">
98-
{%- for child in form %}
99-
{{- form_widget(child, {
100-
parent_label_class: label_attr.class|default(''),
101-
translation_domain: choice_translation_domain,
102-
}) -}}
103-
{% endfor -%}
104-
</div>
97+
{%- for child in form %}
98+
{{- form_widget(child, {
99+
parent_label_class: label_attr.class|default(''),
100+
translation_domain: choice_translation_domain,
101+
}) -}}
102+
{% endfor -%}
105103
{%- else -%}
106104
<div {{ block('widget_container_attributes') }}>
107105
{%- for child in form %}

src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,24 +1542,39 @@ public function testErrorMappingForFormInheritingParentData($target, $childName,
15421542

15431543
public function testBacktrackIfSeveralSubFormsWithSamePropertyPath()
15441544
{
1545-
$violation = $this->getConstraintViolation('data.address[street]');
15461545
$parent = $this->getForm('parent');
15471546
$child1 = $this->getForm('subform1', 'address');
15481547
$child2 = $this->getForm('subform2', 'address');
1549-
$grandChild = $this->getForm('street');
1548+
$child3 = $this->getForm('subform3', null, null, array(), true);
1549+
$child4 = $this->getForm('subform4', null, null, array(), true);
1550+
$grandChild1 = $this->getForm('street');
1551+
$grandChild2 = $this->getForm('street', '[sub_address1_street]');
1552+
$grandChild3 = $this->getForm('street', '[sub_address2_street]');
15501553

15511554
$parent->add($child1);
15521555
$parent->add($child2);
1553-
$child2->add($grandChild);
1556+
$parent->add($child3);
1557+
$parent->add($child4);
1558+
$child2->add($grandChild1);
1559+
$child3->add($grandChild2);
1560+
$child4->add($grandChild3);
15541561

15551562
$parent->submit(array());
15561563

1557-
$this->mapper->mapViolation($violation, $parent);
1564+
$violation1 = $this->getConstraintViolation('data.address[street]');
1565+
$violation2 = $this->getConstraintViolation('data[sub_address1_street]');
1566+
$violation3 = $this->getConstraintViolation('data[sub_address2_street]');
1567+
$this->mapper->mapViolation($violation1, $parent);
1568+
$this->mapper->mapViolation($violation2, $parent);
1569+
$this->mapper->mapViolation($violation3, $parent);
15581570

1559-
// The error occurred on the child of the second form with the same path
15601571
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
15611572
$this->assertCount(0, $child1->getErrors(), $child1->getName().' should not have an error, but has one');
15621573
$this->assertCount(0, $child2->getErrors(), $child2->getName().' should not have an error, but has one');
1563-
$this->assertEquals(array($this->getFormError($violation, $grandChild)), iterator_to_array($grandChild->getErrors()), $grandChild->getName().' should have an error, but has none');
1574+
$this->assertCount(0, $child3->getErrors(), $child3->getName().' should not have an error, but has one');
1575+
$this->assertCount(0, $child4->getErrors(), $child4->getName().' should not have an error, but has one');
1576+
$this->assertEquals(array($this->getFormError($violation1, $grandChild1)), iterator_to_array($grandChild1->getErrors()), $grandChild1->getName().' should have an error, but has none');
1577+
$this->assertEquals(array($this->getFormError($violation2, $grandChild2)), iterator_to_array($grandChild2->getErrors()), $grandChild2->getName().' should have an error, but has none');
1578+
$this->assertEquals(array($this->getFormError($violation3, $grandChild3)), iterator_to_array($grandChild3->getErrors()), $grandChild3->getName().' should have an error, but has none');
15641579
}
15651580
}

0 commit comments

Comments
 (0)
0