Skip to content

Commit

Permalink
Add adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Dec 8, 2023
1 parent ee88214 commit 1325bec
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/Form/Widget/FormChoiceWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,13 @@ public function testLabelRendering(): void

$html = $this->renderWidget($choice->createView());

if (0 !== preg_match("/7\..\../", Kernel::VERSION)) {
static::assertStringContainsString(
'<li><div class="checkbox"><label><input type="checkbox" id="choice_0" name="choice[]" value="0"><span class="control-label__text">[trans]some[/trans]</span></label></div></li>',
$this->cleanHtmlWhitespace($html)
);
} else {
static::assertStringContainsString(
'<li><div class="checkbox"><label><input type="checkbox" id="choice_0" name="choice[]" value="0" /><span class="control-label__text">[trans]some[/trans]</span></label></div></li>',
$this->cleanHtmlWhitespace($html)
);
}
// TODO: Remove this adapter when dropping support for Symfony < 7.
$html = str_replace('value="0" />', 'value="0">', $html);

static::assertStringContainsString(
'<li><div class="checkbox"><label><input type="checkbox" id="choice_0" name="choice[]" value="0"><span class="control-label__text">[trans]some[/trans]</span></label></div></li>',
$this->cleanHtmlWhitespace($html)
);
}

public function testDefaultValueRendering(): void
Expand Down

0 comments on commit 1325bec

Please sign in to comment.