Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Feb 6, 2024
1 parent 0802276 commit da059a6
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions tests/Type/FormChoiceWidgetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use Sonata\Form\Test\AbstractWidgetTestCase;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\HttpKernel\Kernel;

/**
* @author Christian Gripp <mail@core23.de>
Expand All @@ -36,35 +35,19 @@ public function testLabelRendering(): void
);

$html = $this->renderWidget($choice->createView());
if (version_compare(Kernel::VERSION, '6.4.0', '>=')) {
static::assertStringContainsString(
$this->cleanHtmlWhitespace(
<<<'HTML'
<div id="choice">
<input type="checkbox" id="choice_0" name="choice[]" value="0" >
<label for="choice_0">[trans]some[/trans]</label>
<input type="checkbox" id="choice_1" name="choice[]" value="1" >
<label for="choice_1">[trans]choices[/trans]</label>
</div>
HTML
),
$this->cleanHtmlWhitespace($html)
);
} else {
static::assertStringContainsString(
$this->cleanHtmlWhitespace(
<<<'HTML'
<div id="choice">
<input type="checkbox" id="choice_0" name="choice[]" value="0" />
<label for="choice_0">[trans]some[/trans]</label>
<input type="checkbox" id="choice_1" name="choice[]" value="1" />
<label for="choice_1">[trans]choices[/trans]</label>
</div>
HTML
),
$this->cleanHtmlWhitespace($html)
);
}
static::assertStringContainsString(
$this->cleanHtmlWhitespace(
<<<'HTML'
<div id="choice">
<input type="checkbox" id="choice_0" name="choice[]" value="0" />
<label for="choice_0">[trans]some[/trans]</label>
<input type="checkbox" id="choice_1" name="choice[]" value="1" />
<label for="choice_1">[trans]choices[/trans]</label>
</div>
HTML
),
$this->cleanHtmlWhitespace($html)
);
}

public function testDefaultValueRendering(): void
Expand Down

0 comments on commit da059a6

Please sign in to comment.