Fixed broken tests

This commit is contained in:
Nyholm 2018-02-13 23:04:19 +01:00 committed by Nicolas Grekas
parent cf4e95662e
commit 14e2282513
4 changed files with 205 additions and 239 deletions

View File

@ -217,7 +217,7 @@
{{ widget|raw }} {{ widget|raw }}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}> <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}} {{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
{{- form_errors(form) -}} {{- form_errors(form) -}}
</label> </label>
{%- endif -%} {%- endif -%}

View File

@ -23,7 +23,7 @@
"symfony/asset": "~2.8|~3.0|~4.0", "symfony/asset": "~2.8|~3.0|~4.0",
"symfony/dependency-injection": "~2.8|~3.0|~4.0", "symfony/dependency-injection": "~2.8|~3.0|~4.0",
"symfony/finder": "~2.8|~3.0|~4.0", "symfony/finder": "~2.8|~3.0|~4.0",
"symfony/form": "~3.4|~4.0", "symfony/form": "^3.4.5|^4.0.5",
"symfony/http-foundation": "^3.3.11|~4.0", "symfony/http-foundation": "^3.3.11|~4.0",
"symfony/http-kernel": "~3.2|~4.0", "symfony/http-kernel": "~3.2|~4.0",
"symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-intl-icu": "~1.0",
@ -41,7 +41,7 @@
"symfony/workflow": "~3.3|~4.0" "symfony/workflow": "~3.3|~4.0"
}, },
"conflict": { "conflict": {
"symfony/form": "<3.4", "symfony/form": "<3.4.5",
"symfony/console": "<3.4" "symfony/console": "<3.4"
}, },
"suggest": { "suggest": {

View File

@ -53,7 +53,7 @@ abstract class AbstractBootstrap4HorizontalLayoutTest extends AbstractBootstrap4
$this->assertMatchesXpath($html, $this->assertMatchesXpath($html,
'/legend '/legend
[@class="col-form-label col-sm-2 col-form-legend required"] [@class="col-form-label col-sm-2 col-form-label required"]
[.="[trans]Name[/trans]"] [.="[trans]Name[/trans]"]
' '
); );
@ -144,7 +144,7 @@ abstract class AbstractBootstrap4HorizontalLayoutTest extends AbstractBootstrap4
$this->assertMatchesXpath($html, $this->assertMatchesXpath($html,
'/legend '/legend
[@class="col-sm-2 col-form-legend required"] [@class="col-sm-2 col-form-label required"]
[.="[trans]Custom label[/trans]"] [.="[trans]Custom label[/trans]"]
' '
); );

View File

@ -53,7 +53,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
$this->assertMatchesXpath($html, $this->assertMatchesXpath($html,
'/legend '/legend
[@class="col-form-legend required"] [@class="col-form-label required"]
[.="[trans]Name[/trans]"] [.="[trans]Name[/trans]"]
' '
); );
@ -144,7 +144,7 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
$this->assertMatchesXpath($html, $this->assertMatchesXpath($html,
'/legend '/legend
[@class="col-form-legend required"] [@class="col-form-label required"]
[.="[trans]Custom label[/trans]"] [.="[trans]Custom label[/trans]"]
' '
); );
@ -184,12 +184,10 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
'/div '/div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class form-check-input"][@checked="checked"][@value="1"]
[.=" [trans]Name[/trans]"] /following-sibling::label
[.="[trans]Name[/trans]"]
[@class="form-check-label required"] [@class="form-check-label required"]
[
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class form-check-input"][@checked="checked"][@value="1"]
]
] ]
' '
); );
@ -234,20 +232,16 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -263,11 +257,9 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
'/div '/div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class form-check-input"][not(@checked)]
[.=" [trans]Name[/trans]"] /following-sibling::label
[ [.="[trans]Name[/trans]"]
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class form-check-input"][not(@checked)]
]
] ]
' '
); );
@ -283,11 +275,9 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
'/div '/div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class form-check-input"][@value="foo&bar"]
[.=" [trans]Name[/trans]"] /following-sibling::label
[ [.="[trans]Name[/trans]"]
./input[@type="checkbox"][@name="name"][@id="my&id"][@class="my&class form-check-input"][@value="foo&bar"]
]
] ]
' '
); );
@ -307,20 +297,16 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -343,18 +329,14 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[ /following-sibling::label
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
[ /following-sibling::label
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -383,28 +365,22 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[.=" [trans]label.&a[/trans]"] /following-sibling::label
[ [.="[trans]label.&a[/trans]"]
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
[ /following-sibling::label
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_2"][@value="&c"][not(@checked)]
[.=" [trans]label.&c[/trans]"] /following-sibling::label
[ [.="[trans]label.&c[/trans]"]
./input[@type="radio"][@name="name"][@id="name_2"][@value="&c"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -429,18 +405,14 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[ /following-sibling::label
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
[ /following-sibling::label
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -463,20 +435,16 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[.=" Choice&A"] /following-sibling::label
[ [.="Choice&A"]
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
[.=" Choice&B"] /following-sibling::label
[ [.="Choice&B"]
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -499,20 +467,16 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="radio"][@name="name"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)][@class="foo&bar form-check-input"]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="radio"][@name="name"][@id="name_1"][@value="&b"][not(@checked)][@class="foo&bar form-check-input"]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -536,29 +500,23 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_placeholder"][not(@checked)]
[.=" [trans]Test&Me[/trans]"] /following-sibling::label
[ [.="[trans]Test&Me[/trans]"]
./input[@type="radio"][@name="name"][@id="name_placeholder"][not(@checked)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@checked]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -583,29 +541,23 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_placeholder"][not(@checked)]
[.=" Placeholder&Not&Translated"] /following-sibling::label
[ [.="Placeholder&Not&Translated"]
./input[@type="radio"][@name="name"][@id="name_placeholder"][not(@checked)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@checked]
[.=" Choice&A"] /following-sibling::label
[ [.="Choice&A"]
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
[.=" Choice&B"] /following-sibling::label
[ [.="Choice&B"]
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -627,20 +579,16 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_0"][@checked]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="radio"][@name="name"][@id="name_0"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="radio"][@name="name"][@id="name_1"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -663,29 +611,23 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
[.=" [trans]Choice&C[/trans]"] /following-sibling::label
[ [.="[trans]Choice&C[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -708,18 +650,14 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@value="&a"][@checked]
[ /following-sibling::label
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_1"][@value="&b"][not(@checked)]
[ /following-sibling::label
./input[@type="checkbox"][@name="name[]"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -748,28 +686,22 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@value="&a"][@checked]
[.=" [trans]label.&a[/trans]"] /following-sibling::label
[ [.="[trans]label.&a[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_1"][@value="&b"][not(@checked)]
[ /following-sibling::label
./input[@type="checkbox"][@name="name[]"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_2"][@value="&c"][not(@checked)]
[.=" [trans]label.&c[/trans]"] /following-sibling::label
[ [.="[trans]label.&c[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@value="&c"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -794,18 +726,14 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@value="&a"][@checked]
[ /following-sibling::label
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@value="&a"][@checked]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_1"][@value="&b"][not(@checked)]
[ /following-sibling::label
./input[@type="checkbox"][@name="name[]"][@id="name_1"][@value="&b"][not(@checked)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -829,29 +757,23 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
[.=" Choice&A"] /following-sibling::label
[ [.="Choice&A"]
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
[.=" Choice&B"] /following-sibling::label
[ [.="Choice&B"]
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
[.=" Choice&C"] /following-sibling::label
[ [.="Choice&C"]
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -875,29 +797,23 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
./div ./div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
[.=" [trans]Choice&A[/trans]"] /following-sibling::label
[ [.="[trans]Choice&A[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_0"][@checked][not(@required)]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)][@class="foo&bar form-check-input"]
[.=" [trans]Choice&B[/trans]"] /following-sibling::label
[ [.="[trans]Choice&B[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_1"][not(@checked)][not(@required)][@class="foo&bar form-check-input"]
]
] ]
/following-sibling::div /following-sibling::div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
[.=" [trans]Choice&C[/trans]"] /following-sibling::label
[ [.="[trans]Choice&C[/trans]"]
./input[@type="checkbox"][@name="name[]"][@id="name_2"][@checked][not(@required)]
]
] ]
/following-sibling::input[@type="hidden"][@id="name__token"] /following-sibling::input[@type="hidden"][@id="name__token"]
] ]
@ -913,17 +829,15 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
'/div '/div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input
[@id="my&id"]
[@type="radio"]
[@name="name"]
[@class="my&class form-check-input"]
[@checked="checked"]
[@value="1"]
/following-sibling::label
[@class="form-check-label required"] [@class="form-check-label required"]
[
./input
[@id="my&id"]
[@type="radio"]
[@name="name"]
[@class="my&class form-check-input"]
[@checked="checked"]
[@value="1"]
]
] ]
' '
); );
@ -937,16 +851,14 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
'/div '/div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input
[@id="my&id"]
[@type="radio"]
[@name="name"]
[@class="my&class form-check-input"]
[not(@checked)]
/following-sibling::label
[@class="form-check-label required"] [@class="form-check-label required"]
[
./input
[@id="my&id"]
[@type="radio"]
[@name="name"]
[@class="my&class form-check-input"]
[not(@checked)]
]
] ]
' '
); );
@ -962,16 +874,15 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
'/div '/div
[@class="form-check"] [@class="form-check"]
[ [
./label ./input
[@id="my&id"]
[@type="radio"]
[@name="name"]
[@class="my&class form-check-input"]
[@value="foo&bar"]
/following-sibling::label
[@class="form-check-label required"] [@class="form-check-label required"]
[ [@for="my&id"]
./input
[@id="my&id"]
[@type="radio"]
[@name="name"]
[@class="my&class form-check-input"]
[@value="foo&bar"]
]
] ]
' '
); );
@ -996,6 +907,61 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
$this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class form-control-file')), $this->assertWidgetMatchesXpath($form->createView(), array('attr' => array('class' => 'my&class form-control-file')),
'/input '/input
[@type="file"] [@type="file"]
'
);
}
public function testMoney()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\MoneyType', 1234.56, array(
'currency' => 'EUR',
));
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
'/div
[@class="input-group"]
[
./div
[@class="input-group-prepend"]
[
./span
[@class="input-group-text"]
[contains(.., "")]
]
/following-sibling::input
[@id="my&id"]
[@type="text"]
[@name="name"]
[@class="my&class form-control"]
[@value="1234.56"]
]
'
);
}
public function testPercent()
{
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\PercentType', 0.1);
$this->assertWidgetMatchesXpath($form->createView(), array('id' => 'my&id', 'attr' => array('class' => 'my&class')),
'/div
[@class="input-group"]
[
./input
[@id="my&id"]
[@type="text"]
[@name="name"]
[@class="my&class form-control"]
[@value="10"]
/following-sibling::div
[@class="input-group-append"]
[
./span
[@class="input-group-text"]
[contains(.., "%")]
]
]
' '
); );
} }