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
This commit is contained in:
Fabien Potencier 2020-09-13 07:01:27 +02:00
commit 9fae49fb20
5 changed files with 43 additions and 2 deletions

View File

@ -137,6 +137,39 @@ class EntityTypeTest extends BaseTypeTest
]);
}
/**
* @dataProvider choiceTranslationDomainProvider
*/
public function testChoiceTranslationDomainIsDisabledByDefault($expanded)
{
$entity1 = new SingleIntIdEntity(1, 'Foo');
$this->persist([$entity1]);
$field = $this->factory->createNamed('name', static::TESTED_TYPE, null, [
'choices' => [
$entity1,
],
'class' => SingleIntIdEntity::class,
'em' => 'default',
'expanded' => $expanded,
]);
if ($expanded) {
$this->assertFalse($field->get('1')->getConfig()->getOption('translation_domain'));
} else {
$this->assertFalse($field->getConfig()->getOption('choice_translation_domain'));
}
}
public function choiceTranslationDomainProvider()
{
return [
[false],
[true],
];
}
public function testSetDataToUninitializedEntityWithNonRequired()
{
$entity1 = new SingleIntIdEntity(1, 'Foo');

View File

@ -30,7 +30,7 @@
"symfony/cache": "^5.1",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/form": "^5.1",
"symfony/form": "^5.1.3",
"symfony/http-kernel": "^5.0",
"symfony/messenger": "^4.4|^5.0",
"symfony/doctrine-messenger": "^5.1",

View File

@ -147,6 +147,10 @@ class Deprecation
public function isLegacy()
{
$class = $this->originatingClass();
if ((new \ReflectionClass($class))->isInternal()) {
return false;
}
$method = $this->originatingMethod();
return 0 === strpos($method, 'testLegacy')

View File

@ -42,6 +42,10 @@ class ResponseFunctionalTest extends TestCase
*/
public function testCookie($fixture)
{
if (\PHP_VERSION_ID >= 80000 && 'cookie_max_age' === $fixture) {
$this->markTestSkipped('This fixture produces a fatal error on PHP 8.');
}
$result = file_get_contents(sprintf('http://localhost:8054/%s.php', $fixture));
$this->assertStringMatchesFormatFile(__DIR__.sprintf('/Fixtures/response-functional/%s.expected', $fixture), $result);
}

View File

@ -84,7 +84,7 @@
</trans-unit>
<trans-unit id="21">
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
<target>Bu değer çok kısa. {{ limit }} karakter veya daha fazla olmaldır.</target>
<target>Bu değer çok kısa. {{ limit }} karakter veya daha fazla olmalıdır.</target>
</trans-unit>
<trans-unit id="22">
<source>This value should not be blank.</source>