Skip to content

Commit f2febb7

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Internal classes are not legacy. [HttpFoundation] Skip the cookie_max_age fixture on PHP 8. add choice_translation_domain tests to prevent further regressions Update validators.tr.xlf
2 parents d2d94e0 + 39cfb22 commit f2febb7

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

Tests/Form/Type/EntityTypeTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,39 @@ public function testInvalidClassOption()
137137
]);
138138
}
139139

140+
/**
141+
* @dataProvider choiceTranslationDomainProvider
142+
*/
143+
public function testChoiceTranslationDomainIsDisabledByDefault($expanded)
144+
{
145+
$entity1 = new SingleIntIdEntity(1, 'Foo');
146+
147+
$this->persist([$entity1]);
148+
149+
$field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
150+
'choices' => [
151+
$entity1,
152+
],
153+
'class' => SingleIntIdEntity::class,
154+
'em' => 'default',
155+
'expanded' => $expanded,
156+
]);
157+
158+
if ($expanded) {
159+
$this->assertFalse($field->get('1')->getConfig()->getOption('translation_domain'));
160+
} else {
161+
$this->assertFalse($field->getConfig()->getOption('choice_translation_domain'));
162+
}
163+
}
164+
165+
public function choiceTranslationDomainProvider()
166+
{
167+
return [
168+
[false],
169+
[true],
170+
];
171+
}
172+
140173
public function testSetDataToUninitializedEntityWithNonRequired()
141174
{
142175
$entity1 = new SingleIntIdEntity(1, 'Foo');

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"symfony/cache": "^5.1",
3131
"symfony/config": "^4.4|^5.0",
3232
"symfony/dependency-injection": "^4.4|^5.0",
33-
"symfony/form": "^5.1",
33+
"symfony/form": "^5.1.3",
3434
"symfony/http-kernel": "^5.0",
3535
"symfony/messenger": "^4.4|^5.0",
3636
"symfony/doctrine-messenger": "^5.1",

0 commit comments

Comments
 (0)