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