From 1325bec57062ec33ae5ffc240c5669d6ab058639 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Fri, 8 Dec 2023 09:43:22 +0100 Subject: [PATCH] Add adapter --- tests/Form/Widget/FormChoiceWidgetTest.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/Form/Widget/FormChoiceWidgetTest.php b/tests/Form/Widget/FormChoiceWidgetTest.php index 75057ce8d9..13d933856a 100644 --- a/tests/Form/Widget/FormChoiceWidgetTest.php +++ b/tests/Form/Widget/FormChoiceWidgetTest.php @@ -41,17 +41,13 @@ public function testLabelRendering(): void $html = $this->renderWidget($choice->createView()); - if (0 !== preg_match("/7\..\../", Kernel::VERSION)) { - static::assertStringContainsString( - '
  • ', - $this->cleanHtmlWhitespace($html) - ); - } else { - static::assertStringContainsString( - '
  • ', - $this->cleanHtmlWhitespace($html) - ); - } + // TODO: Remove this adapter when dropping support for Symfony < 7. + $html = str_replace('value="0" />', 'value="0">', $html); + + static::assertStringContainsString( + '
  • ', + $this->cleanHtmlWhitespace($html) + ); } public function testDefaultValueRendering(): void