[AddressingBundle] Fix compatibility with Symfony 5

This commit is contained in:
Kamil Kokot 2021-01-12 13:26:30 +01:00
parent 333c4e278c
commit db4d4f8004
2 changed files with 18 additions and 8 deletions

View file

@ -1,8 +1,12 @@
vendor/
bin/
/vendor/
/bin/
composer.phar
composer.lock
/composer.phar
/composer.lock
test/app/cache
test/app/logs
/test/app/cache
/test/app/logs
/test/var/cache
/test/var/logs
/.phpunit.result.cache

View file

@ -110,7 +110,11 @@ final class CountryChoiceTypeTest extends TypeTestCase
$this->poland->reveal(),
]);
$this->assertChoicesLabels(['Poland'], ['choice_filter' => function (CountryInterface $country): bool {
$this->assertChoicesLabels(['Poland'], ['choice_filter' => static function (?CountryInterface $country): bool {
if ($country === null) {
return false;
}
return $country->getName() === 'Poland';
}]);
}
@ -120,7 +124,9 @@ final class CountryChoiceTypeTest extends TypeTestCase
$form = $this->factory->create(CountryChoiceType::class, null, $formConfiguration);
$view = $form->createView();
Assert::assertSame($expectedLabels, array_map(function (ChoiceView $choiceView): string {
$i = 1;
Assert::assertSame($expectedLabels, array_map(static function (ChoiceView $choiceView): string {
return $choiceView->label;
}, $view->vars['choices']));
}