Skip to content

Commit

Permalink
Merge 2.x into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Feb 7, 2024
2 parents 4d1fac5 + da059a6 commit 4331156
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 32 deletions.
3 changes: 1 addition & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;

Expand All @@ -33,7 +32,7 @@

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
PHPUnitLevelSetList::UP_TO_PHPUNIT_90,
PHPUnitSetList::PHPUNIT_90,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
]);

Expand Down
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 <[email protected]>
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 4331156

Please sign in to comment.