Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[TwigBridge] Remove VersionAwareTest from AbstractLayoutTestCase #58411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2869,8 +2869,6 @@ public function testColor()

public function testWeekSingleText()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
'input' => 'string',
'widget' => 'single_text',
Expand All @@ -2889,8 +2887,6 @@ public function testWeekSingleText()

public function testWeekSingleTextNoHtml5()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
'input' => 'string',
'widget' => 'single_text',
Expand All @@ -2910,8 +2906,6 @@ public function testWeekSingleTextNoHtml5()

public function testWeekChoices()
{
$this->requiresFeatureSet(404);

$data = ['year' => (int) date('Y'), 'week' => 1];

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
Expand All @@ -2938,8 +2932,6 @@ public function testWeekChoices()

public function testWeekText()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [
'input' => 'string',
'widget' => 'text',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1842,8 +1842,6 @@ public function testTimezoneWithPlaceholder()

public function testWeekChoices()
{
$this->requiresFeatureSet(404);

$data = ['year' => (int) date('Y'), 'week' => 1];

$form = $this->factory->createNamed('name', WeekType::class, $data, [
Expand Down
37 changes: 0 additions & 37 deletions src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\Tests\VersionAwareTest;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
use Symfony\Component\Translation\TranslatableMessage;
use Symfony\Contracts\Translation\TranslatableInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

abstract class AbstractLayoutTestCase extends FormLayoutTestCase
{
use VersionAwareTest;

protected MockObject&CsrfTokenManagerInterface $csrfTokenManager;
protected array $testableFeatures = [];

Expand Down Expand Up @@ -672,8 +669,6 @@ public function testSingleExpandedChoiceAttributesWithMainAttributes()

public function testSingleChoiceWithPreferred()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [
'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'],
'preferred_choices' => ['&b'],
Expand All @@ -698,8 +693,6 @@ public function testSingleChoiceWithPreferred()

public function testSingleChoiceWithPreferredAndNoSeparator()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [
'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'],
'preferred_choices' => ['&b'],
Expand All @@ -723,8 +716,6 @@ public function testSingleChoiceWithPreferredAndNoSeparator()

public function testSingleChoiceWithPreferredAndBlankSeparator()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [
'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'],
'preferred_choices' => ['&b'],
Expand All @@ -749,8 +740,6 @@ public function testSingleChoiceWithPreferredAndBlankSeparator()

public function testChoiceWithOnlyPreferred()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', '&a', [
'choices' => ['Choice&A' => '&a', 'Choice&B' => '&b'],
'preferred_choices' => ['&a', '&b'],
Expand Down Expand Up @@ -1814,8 +1803,6 @@ public function testNumber()

public function testRenderNumberWithHtml5NumberType()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\NumberType', 1234.56, [
'html5' => true,
]);
Expand All @@ -1832,8 +1819,6 @@ public function testRenderNumberWithHtml5NumberType()

public function testRenderNumberWithHtml5NumberTypeAndStepAttribute()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\NumberType', 1234.56, [
'html5' => true,
'attr' => ['step' => '0.1'],
Expand Down Expand Up @@ -1908,8 +1893,6 @@ public function testPercent()

public function testPercentNoSymbol()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => false, 'rounding_mode' => \NumberFormatter::ROUND_CEILING]);
$this->assertWidgetMatchesXpath($form->createView(), [],
'/input
Expand All @@ -1923,8 +1906,6 @@ public function testPercentNoSymbol()

public function testPercentCustomSymbol()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', PercentType::class, 0.1, ['symbol' => '‱', 'rounding_mode' => \NumberFormatter::ROUND_CEILING]);
$this->assertWidgetMatchesXpath($form->createView(), [],
'/input
Expand Down Expand Up @@ -2602,8 +2583,6 @@ public function testColor()

public function testLabelWithTranslationParameters()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
$html = $this->renderLabel($form->createView(), 'Address is %address%', [
'label_translation_parameters' => [
Expand All @@ -2621,8 +2600,6 @@ public function testLabelWithTranslationParameters()

public function testHelpWithTranslationParameters()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [
'help' => 'for company %company%',
'help_translation_parameters' => [
Expand Down Expand Up @@ -2693,8 +2670,6 @@ public function trans(TranslatorInterface $translator, ?string $locale = null):

public function testAttributesWithTranslationParameters()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [
'attr' => [
'title' => 'Message to %company%',
Expand All @@ -2716,8 +2691,6 @@ public function testAttributesWithTranslationParameters()

public function testButtonWithTranslationParameters()
{
$this->requiresFeatureSet(403);

$form = $this->factory->createNamedBuilder('myform')
->add('mybutton', 'Symfony\Component\Form\Extension\Core\Type\ButtonType', [
'label' => 'Submit to %company%',
Expand All @@ -2741,8 +2714,6 @@ public function testButtonWithTranslationParameters()
*/
public function testSubmitFormNoValidate(bool $validate)
{
$this->requiresFeatureSet(404);

$form = $this->factory->create(SubmitType::class, null, [
'validate' => $validate,
]);
Expand Down Expand Up @@ -2772,8 +2743,6 @@ public static function submitFormNoValidateProvider()

public function testWeekSingleText()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
'input' => 'string',
'widget' => 'single_text',
Expand All @@ -2791,8 +2760,6 @@ public function testWeekSingleText()

public function testWeekSingleTextNoHtml5()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('holidays', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '1970-W01', [
'input' => 'string',
'widget' => 'single_text',
Expand All @@ -2811,8 +2778,6 @@ public function testWeekSingleTextNoHtml5()

public function testWeekChoices()
{
$this->requiresFeatureSet(404);

$data = ['year' => (int) date('Y'), 'week' => 1];

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', $data, [
Expand All @@ -2837,8 +2802,6 @@ public function testWeekChoices()

public function testWeekText()
{
$this->requiresFeatureSet(404);

$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\WeekType', '2000-W01', [
'input' => 'string',
'widget' => 'text',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
abstract class FormPerformanceTestCase extends FormIntegrationTestCase
{
use RunTestTrait;
use VersionAwareTest;

/**
* @var int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/
abstract class BaseTypeTestCase extends TypeTestCase
{
use VersionAwareTest;

public const TESTED_TYPE = '';

public function testPassDisabledAsOption()
Expand Down Expand Up @@ -114,8 +112,6 @@ public function testDefaultTranslationDomain()

public function testPassLabelTranslationParametersToView()
{
$this->requiresFeatureSet(403);

$view = $this->factory->create($this->getTestedType(), null, array_merge($this->getTestOptions(), [
'label_translation_parameters' => ['%param%' => 'value'],
]))
Expand All @@ -126,8 +122,6 @@ public function testPassLabelTranslationParametersToView()

public function testPassAttrTranslationParametersToView()
{
$this->requiresFeatureSet(403);

$view = $this->factory->create($this->getTestedType(), null, array_merge($this->getTestOptions(), [
'attr_translation_parameters' => ['%param%' => 'value'],
]))
Expand All @@ -138,8 +132,6 @@ public function testPassAttrTranslationParametersToView()

public function testInheritLabelTranslationParametersFromParent()
{
$this->requiresFeatureSet(403);

$view = $this->factory
->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [
'label_translation_parameters' => ['%param%' => 'value'],
Expand All @@ -153,8 +145,6 @@ public function testInheritLabelTranslationParametersFromParent()

public function testInheritAttrTranslationParametersFromParent()
{
$this->requiresFeatureSet(403);

$view = $this->factory
->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [
'attr_translation_parameters' => ['%param%' => 'value'],
Expand All @@ -168,8 +158,6 @@ public function testInheritAttrTranslationParametersFromParent()

public function testPreferOwnLabelTranslationParameters()
{
$this->requiresFeatureSet(403);

$view = $this->factory
->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [
'label_translation_parameters' => ['%parent_param%' => 'parent_value', '%override_param%' => 'parent_override_value'],
Expand All @@ -185,8 +173,6 @@ public function testPreferOwnLabelTranslationParameters()

public function testPreferOwnAttrTranslationParameters()
{
$this->requiresFeatureSet(403);

$view = $this->factory
->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE, null, [
'attr_translation_parameters' => ['%parent_param%' => 'parent_value', '%override_param%' => 'parent_override_value'],
Expand All @@ -202,8 +188,6 @@ public function testPreferOwnAttrTranslationParameters()

public function testDefaultLabelTranslationParameters()
{
$this->requiresFeatureSet(403);

$view = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE)
->add('child', $this->getTestedType(), $this->getTestOptions())
->getForm()
Expand All @@ -214,8 +198,6 @@ public function testDefaultLabelTranslationParameters()

public function testDefaultAttrTranslationParameters()
{
$this->requiresFeatureSet(403);

$view = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE)
->add('child', $this->getTestedType(), $this->getTestOptions())
->getForm()
Expand Down